Relationship
class Relationship (View source)
Properties
| protected Factory | $factory | The related factory instance. |
|
| protected string | $relationship | The relationship name. |
Methods
void
$this
Details
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.
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.