Skip to content

Commit

Permalink
Change formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cjmellor authored Aug 8, 2024
1 parent 73e556e commit 0f5a6c1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Concerns/GiveExperience.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,11 @@ public function addPoints(
*/
if ($this->experience()->doesntExist()) {
$level = Level::query()
->where(column: 'next_level_experience', operator: '<=', value: $amount)
->orderByDesc(column: 'next_level_experience')
->first();
->firstWhere(column: 'next_level_experience', operator: '<=', value: $amount)
->orderByDesc(column: 'next_level_experience');

if ($level === null) {
$level = Level::query()
->where(column: 'level', operator: '=', value: config(key: 'level-up.starting_level'))
->first();
$level = Level::firstWhere(column: 'level', operator: '=', value: config(key: 'level-up.starting_level'));
}

$experience = $this->experience()->create(attributes: [
Expand Down

0 comments on commit 0f5a6c1

Please sign in to comment.