Skip to content

Commit

Permalink
Use the getAttributes method on insert (laravel#25349)
Browse files Browse the repository at this point in the history
Update the performInsert method to use getAttributes instead of accessing the property directly.
  • Loading branch information
ollieread authored and EspadaV8 committed Jan 28, 2021
1 parent 2af24db commit f8e0427
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ protected function performInsert(Builder $query)
// If the model has an incrementing key, we can use the "insertGetId" method on
// the query builder, which will give us back the final inserted ID for this
// table from the database. Not all tables have to be incrementing though.
$attributes = $this->attributes;
$attributes = $this->getAttributes();

if ($this->getIncrementing()) {
$this->insertAndSetId($query, $attributes);
Expand Down

0 comments on commit f8e0427

Please sign in to comment.