Skip to content

Commit

Permalink
Merge pull request #275 from bowphp/papac-patch-1
Browse files Browse the repository at this point in the history
Update Model.php
  • Loading branch information
papac authored Oct 27, 2023
2 parents f2b0ab8 + 1676f73 commit 9b41fa2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Database/Barry/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ private function writeRows(Builder $builder)
$primary_key_value = static::$builder->getPdo()->lastInsertId();
}

if (is_null($primary_key_value)) {
if (is_null($primary_key_value) || $primary_key_value == 0) {
$primary_key_value = $this->attributes[$this->primary_key] ?? null;
}

Expand Down

0 comments on commit 9b41fa2

Please sign in to comment.