trait ComparesRelatedModels (View source)
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. | |
mixed | getParentKey() Get the value of the parent model's key. | |
mixed | getRelatedKeyFrom(Model $model) Get the value of the model's related key. | |
bool | compareKeys(mixed $parentKey, mixed $relatedKey) Compare the parent key with the related key. |
Determine if the model is the related instance of the relationship.
Determine if the model is not the related instance of the relationship.
Get the value of the parent model's key.
Get the value of the model's related key.
Compare the parent key with the related key.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Database/Eloquent/Relations/Concerns/ComparesRelatedModels.html