sync()
Synchronizes an array of data for related models with a parent model.
public
sync(
$data :
array
[, $deleting :
bool
= true ]
[, $forceCreate :
bool
= false ]
[, $relatedKeyName :
string
= null ]
)
: mixed
Parameters
- $data : array
- $deleting : bool = true
Delete models from the database that are not represented in the input data.
- $forceCreate : bool = false
Ignore mass assignment restrictions on child models.
- $relatedKeyName : string = null
The primary key used to determine which child models are new, updated, or deleted.