the browser-facing portion of osu!
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

use `firstOrCreate` for `replayViewCount()`

tsunyoku 22348350 f2620b4e

+4 -5
+3 -5
app/Http/Controllers/ScoresController.php
··· 73 73 ->increment('count'); 74 74 75 75 if ($score instanceof ScoreBest) { 76 - if (!$score->replayViewCount()->exists()) { 77 - $score->replayViewCount()->create(['play_count' => 0]); 78 - } 79 - 80 - $score->replayViewCount()->increment('play_count'); 76 + $score->replayViewCount() 77 + ->firstOrCreate([], ['play_count' => 0]) 78 + ->incrementInstance('play_count'); 81 79 } 82 80 } 83 81
+1
app/Models/ReplayViewCount/Model.php
··· 13 13 protected $primaryKey = 'score_id'; 14 14 15 15 public $timestamps = false; 16 + public $incrementing = false; 16 17 17 18 protected static function suffix() 18 19 {