HasUuids
trait HasUuids (View source)
Traits
Methods
Generate a new unique key for the model.
Determine if given key is valid.
Retrieve the model for a bound value.
Get the value indicating whether the IDs are incrementing.
Throw an exception for the given invalid unique ID.
Details
string
newUniqueId()
Generate a new unique key for the model.
protected bool
isValidUniqueId(mixed $value)
Determine if given key is valid.
void
initializeHasUniqueStringIds()
Initialize the trait.
array
uniqueIds()
Get the columns that should receive a unique identifier.
Builder
resolveRouteBindingQuery(Model|Relation<mixed, mixed, mixed> $query, mixed $value, string|null $field = null)
Retrieve the model for a bound value.
string
getKeyType()
Get the auto-incrementing key type.
bool
getIncrementing()
Get the value indicating whether the IDs are incrementing.
protected never
handleInvalidUniqueId(mixed $value, string|null $field)
Throw an exception for the given invalid unique ID.
Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.