Skip to content

Commit

Permalink
Fix nickname in Laravel pulse
Browse files Browse the repository at this point in the history
  • Loading branch information
mintopia committed Dec 2, 2023
1 parent 64b7efd commit a3287c5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\Services\SpotifyAPIRequest;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
Expand Down Expand Up @@ -197,4 +198,11 @@ public function getSpotifyStatus()
$this->save();
return $this->status;
}

protected function name(): Attribute
{
return Attribute::make(
get: fn (mixed $value, array $attributes) => $attributes['nickname'],
);
}
}

0 comments on commit a3287c5

Please sign in to comment.