Commit b6af2bea authored by Pooya Parsa's avatar Pooya Parsa

formatSyncList legacy support

parent 76281c1b
......@@ -286,4 +286,24 @@ class BelongsToMany extends EloquentBelongsToMany
{
return $this->foreignKey;
}
/**
* Format the sync list so that it is keyed by ID. (Legacy Support)
* The original function has been renamed to formatRecordsList since Laravel 5.3
*
* @deprecated
* @param array $records
* @return array
*/
protected function formatSyncList(array $records)
{
$results = [];
foreach ($records as $id => $attributes) {
if (! is_array($attributes)) {
list($id, $attributes) = [$attributes, []];
}
$results[$id] = $attributes;
}
return $results;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment