Admin Panel
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-09-29 14:57:37 +07:00
parent 04fbddba13
commit 8c6dad2a31
94 changed files with 4864 additions and 1151 deletions
+12 -1
View File
@@ -3,6 +3,7 @@
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use App\Enums\UserRole;
use Database\Factories\UserFactory;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Attributes\Hidden;
@@ -18,6 +19,7 @@ use Laravel\Fortify\TwoFactorAuthenticatable;
* @property int $id
* @property string $name
* @property string $email
* @property UserRole $role
* @property Carbon|null $email_verified_at
* @property string $password
* @property string|null $two_factor_secret
@@ -27,7 +29,7 @@ use Laravel\Fortify\TwoFactorAuthenticatable;
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
*/
#[Fillable(['name', 'email', 'password'])]
#[Fillable(['name', 'email', 'role', 'password'])]
#[Hidden(['password', 'two_factor_secret', 'two_factor_recovery_codes', 'remember_token'])]
class User extends Authenticatable implements PasskeyUser
{
@@ -44,7 +46,16 @@ class User extends Authenticatable implements PasskeyUser
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
'role' => UserRole::class,
'two_factor_confirmed_at' => 'datetime',
];
}
/**
* Admins manage users on top of everything an editor can do.
*/
public function isAdmin(): bool
{
return $this->role === UserRole::Admin;
}
}