class Relationship (View source)

Properties

protected Factory $factory

The related factory instance.

protected string $relationship

The relationship name.

Methods

void
__construct(Factory $factory, string $relationship)

Create a new child relationship instance.

void
createFor(Model $parent)

Create the child relationship for the given parent model.

$this
recycle(Collection $recycle)

Specify the model instances to always use when creating relationships.

Details

void __construct(Factory $factory, string $relationship)

Create a new child relationship instance.

Parameters

Factory $factory
string $relationship

Return Value

void

void createFor(Model $parent)

Create the child relationship for the given parent model.

Parameters

Model $parent

Return Value

void

$this recycle(Collection $recycle)

Specify the model instances to always use when creating relationships.

Parameters

Collection $recycle

Return Value

$this