BelongsToRelationship
class BelongsToRelationship
Properties
| protected Factory|Model | $factory | The related factory instance. |
|
| protected string | $relationship | The relationship name. |
|
| protected int|string|null | $resolved | The cached, resolved parent instance ID. |
Methods
__construct(Factory|Model $factory, string $relationship)
Create a new "belongs to" relationship definition.
array
attributesFor(Model $model)
Get the parent model attributes and resolvers for the given child model.
Details
at line 32
__construct(Factory|Model $factory, string $relationship)
Create a new "belongs to" relationship definition.
at line 41
array
attributesFor(Model $model)
Get the parent model attributes and resolvers for the given child model.
at line 56
protected Closure
resolver(string|null $key)
Get the deferred resolver for this relationship's parent ID.
at line 76
BelongsToRelationship
recycle(Collection $recycle)
Specify the model instances to always use when creating relationships.