Skip to content

Commit

Permalink
Refactor stat increment logic
Browse files Browse the repository at this point in the history
  • Loading branch information
maru0914 committed Jul 8, 2024
1 parent ed4b32e commit adb0948
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/Observers/ProjectObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ class ProjectObserver
*/
public function created(Project $project): void
{
$stat = Stat::firstOrCreate();
$stat->projects_count++;
$stat->save();
Stat::first()->increment('projects_count');
}
}

0 comments on commit adb0948

Please sign in to comment.