trait
Illuminate
/
Database
/
Eloquent
/
Relations
/
Concerns
/
ComparesRelatedModels
You're browsing the documentation for an upcoming version of Laravel. The documentation and features of this release are subject to change.
ComparesRelatedModels
Methods
public
is ( $model ) : bool
Determine if the model is the related instance of the relationship.
Parameters
- $model Model |null
public
isNot ( $model ) : bool
Determine if the model is not the related instance of the relationship.
Parameters
- $model Model |null
public
abstract
getParentKey ( ) : mixed
Get the value of the parent model's key.
protected
abstract
getRelatedKeyFrom ( Model $model ) : mixed
Get the value of the model's related key.
Parameters
- $model Model
protected
compareKeys ( $parentKey , $relatedKey ) : bool
Compare the parent key with the related key.
Parameters
- $parentKey mixed
- $relatedKey mixed