class
Illuminate
/
Database
/
Eloquent
/
Factories
/
BelongsToManyRelationship
BelongsToManyRelationship
Properties
protected
$factory Illuminate\...\Factory|Illuminate\...\Collection|Model |array
The related factory instance.
Default: null
protected
$pivot callable|array
The pivot attributes / attribute resolver.
Default: null
protected
$relationship string
The relationship name.
Default: null
Methods
public
__construct ( $factory , $pivot , $relationship ) : void
Create a new attached relationship definition.
Parameters
- $factory Illuminate\...\Factory|Illuminate\...\Collection|Model |array
- $pivot callable|array
- $relationship string
public
createFor ( Model $model ) : void
Create the attached relationship for the given model.
Parameters
- $model Model
public
recycle ( $recycle ) : $this
Specify the model instances to always use when creating relationships.
Parameters
- $recycle Illuminate\...\Collection