diff --git a/app/Models/User.php b/app/Models/User.php index 739b511a..34bc4ebb 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; +use Illuminate\Support\Collection; use Illuminate\Support\Facades\Cache; use Laravel\Cashier\Billable; use Laravel\Fortify\TwoFactorAuthenticatable; @@ -116,11 +117,12 @@ public function activeAffiliate(): HasOne|Affiliate ->where('uses', '>', 0); } - public function getBadges(): array + public function getBadges(): array|Collection { - $badges = []; - if($this->activeAffiliate()->count()) { - $badges[] .= 'badges.affiliate'; + $badges = collect(); + if($this->activeAffiliate()->count()) + { + $badges->push('badges.affiliate'); } return $badges; }