Implement admin and user management foundation

This commit is contained in:
2026-03-25 00:38:30 +01:00
parent 9d90bde323
commit aeee3d2640
17 changed files with 505 additions and 25 deletions
+11
View File
@@ -28,6 +28,7 @@ class UserFactory extends Factory
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'email_verified_at' => now(),
'is_admin' => false,
'password' => static::$password ??= Hash::make('password'),
'remember_token' => Str::random(10),
'two_factor_secret' => null,
@@ -57,4 +58,14 @@ class UserFactory extends Factory
'two_factor_confirmed_at' => now(),
]);
}
/**
* Indicate that the user has application admin access.
*/
public function admin(): static
{
return $this->state(fn (array $attributes) => [
'is_admin' => true,
]);
}
}