This commit is contained in:
Dennis
2025-01-07 10:19:12 +01:00
parent ba2b932bb8
commit 528868c1df

View File

@@ -55,21 +55,13 @@ class User extends Authenticatable implements HasLocalePreference, TwoFactorAuth
'keyboard_shortcuts' => 'boolean',
'requires_password_for_ftp' => 'boolean',
'trial_ends_at' => 'datetime',
'password' => 'hashed'
];
protected $appends = [
'avatar',
];
public function setPasswordAttribute($value)
{
if (! $value) {
$this->attributes['password'] = null;
} else {
$this->attributes['password'] = bcrypt($value);
}
}
public function canAccessPanel(Panel $panel): bool
{
return $this->role === self::ADMIN;