chore: add phpstan static analysis minimum (#4511)
This commit is contained in:
parent
3f7e2a565f
commit
a1a52754ad
67 changed files with 561 additions and 279 deletions
|
@ -11,6 +11,7 @@ use Illuminate\Notifications\Notifiable;
|
|||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Pterodactyl\Models\Traits\HasAccessTokens;
|
||||
use Illuminate\Auth\Passwords\CanResetPassword;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Pterodactyl\Traits\Helpers\AvailableLanguages;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Foundation\Auth\Access\Authorizable;
|
||||
|
@ -129,6 +130,10 @@ class User extends Model implements
|
|||
'root_admin',
|
||||
];
|
||||
|
||||
protected $appends = [
|
||||
'md5',
|
||||
];
|
||||
|
||||
/**
|
||||
* Cast values to correct type.
|
||||
*/
|
||||
|
@ -259,6 +264,13 @@ class User extends Model implements
|
|||
return $this->morphToMany(ActivityLog::class, 'subject', 'activity_log_subjects');
|
||||
}
|
||||
|
||||
public function md5(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn () => md5(strtolower($this->email)),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the servers that a user can access by way of being the owner of the
|
||||
* server, or because they are assigned as a subuser for that server.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue