feat: add admin seeder and is_admin factory state
Runs is_admin migration, adds AdminSeeder for the admin user, registers it in DatabaseSeeder, adds admin() factory state to UserFactory, and adds AdminAccessTest covering both forbidden and ok cases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -57,4 +57,12 @@ class UserFactory extends Factory
|
||||
'two_factor_confirmed_at' => now(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the user is an admin.
|
||||
*/
|
||||
public function admin(): static
|
||||
{
|
||||
return $this->state(['is_admin' => true]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user