Skip to content

Commit aea765e

Browse files
author
Pantea Marius-ciclistu
committed
1 parent 02bd9cc commit aea765e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

illuminate/Database/Eloquent/Concerns/HasAttributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1912,7 +1912,7 @@ public function getAttributes()
19121912
*/
19131913
protected function getAttributesForInsert()
19141914
{
1915-
return $this->getAttributes();
1915+
return $this->tmpOriginalBeforeAfterEvents = $this->getAttributes();
19161916
}
19171917

19181918
/**

illuminate/Database/Eloquent/Model.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,8 +1371,8 @@ protected function performInsert(Builder $query)
13711371
// If the table isn't incrementing we'll simply insert these attributes as they
13721372
// are. These attribute arrays must contain an "id" column previously placed
13731373
// there by the developer as the manually determined key for these models.
1374-
if (empty($attributes)) {
1375-
return true;
1374+
if ([] === $attributes) {
1375+
return false;
13761376
}
13771377

13781378
$query->insert($attributes);

0 commit comments

Comments
 (0)