Skip to content

Commit

Permalink
Merge pull request #5 from firevel/bugfix/save-only-dirty-models
Browse files Browse the repository at this point in the history
Save user model only while is dirty
  • Loading branch information
sl0wik authored Nov 22, 2019
2 parents d3336da + e8c3b37 commit 53c870e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/FirebaseAuthenticable.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ public function updateOrCreateUser($id, array $attributes): object
{
if ($user = $this->find($id)) {
$user
->fill($attributes)
->save();
->fill($attributes);

if ($user->isDirty()) {
$user->save();
}

return $user;
}
Expand Down

0 comments on commit 53c870e

Please sign in to comment.