ComparesRelatedModels
trait ComparesRelatedModels (View source)
Methods
bool
mixed
getParentKey()
Get the value of the parent model's key.
mixed
bool
compareKeys(mixed $parentKey, mixed $relatedKey)
Compare the parent key with the related key.
Details
bool
is(Model|null $model)
Determine if the model is the related instance of the relationship.
bool
isNot(Model|null $model)
Determine if the model is not the related instance of the relationship.
abstract mixed
getParentKey()
Get the value of the parent model's key.
abstract protected mixed
getRelatedKeyFrom(Model $model)
Get the value of the model's related key.
protected bool
compareKeys(mixed $parentKey, mixed $relatedKey)
Compare the parent key with the related key.
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.