You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 More fixes 🆙
This commit is contained in:
@@ -66,6 +66,7 @@ use Spatie\Activitylog\Traits\LogsActivity;
|
||||
* @property \Illuminate\Support\Carbon|null $two_factor_confirmed_at
|
||||
* @property string|null $remember_token
|
||||
* @property \Illuminate\Support\Carbon|null $email_verified_at
|
||||
* @property int $website_balance
|
||||
*/
|
||||
class User extends Authenticatable implements FilamentUser, HasName
|
||||
{
|
||||
@@ -260,23 +261,32 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Collection<int, MessengerFriendship>
|
||||
* @return \Illuminate\Database\Eloquent\Collection<int, \App\Models\Game\Player\MessengerFriendship>
|
||||
*/
|
||||
public function getOnlineFriends(int $total = 10): \Illuminate\Database\Eloquent\Collection
|
||||
{
|
||||
return $this->friends()
|
||||
/** @var \Illuminate\Database\Eloquent\Collection<int, \App\Models\Game\Player\MessengerFriendship> $friends */
|
||||
$friends = $this->friends()
|
||||
->select(['user_two_id', 'users.id', 'users.username', 'users.look', 'users.motto', 'users.last_online'])
|
||||
->join('users', 'users.id', '=', 'user_two_id')
|
||||
->where('users.online', '1')
|
||||
->inRandomOrder()
|
||||
->limit($total)
|
||||
->get();
|
||||
|
||||
return $friends;
|
||||
}
|
||||
|
||||
public function confirmTwoFactorAuthentication(string $code): void
|
||||
public function confirmTwoFactorAuthentication(string $code): bool
|
||||
{
|
||||
$secret = $this->two_factor_secret;
|
||||
|
||||
if (! is_string($secret)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$codeIsValid = app(TwoFactorAuthenticationProvider::class)
|
||||
->verify(decrypt($this->two_factor_secret), $code);
|
||||
->verify(decrypt($secret), $code);
|
||||
|
||||
if (! $codeIsValid) {
|
||||
return false;
|
||||
@@ -289,12 +299,12 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
return true;
|
||||
}
|
||||
|
||||
public function hasAppliedForPosition(int $rankId)
|
||||
public function hasAppliedForPosition(int $rankId): bool
|
||||
{
|
||||
return $this->applications()->where('rank_id', '=', $rankId)->exists();
|
||||
}
|
||||
|
||||
public function changePassword(string $newPassword)
|
||||
public function changePassword(string $newPassword): void
|
||||
{
|
||||
$this->password = Hash::make($newPassword);
|
||||
$this->save();
|
||||
@@ -307,7 +317,7 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
|
||||
public function canAccessPanel(Panel $panel): bool
|
||||
{
|
||||
return hasHousekeepingPermission('can_access_housekeeping');
|
||||
return (bool) hasHousekeepingPermission('can_access_housekeeping');
|
||||
}
|
||||
|
||||
public function getActivitylogOptions(): LogOptions
|
||||
|
||||
Reference in New Issue
Block a user