Skip to content

Commit bbdbb11

Browse files
committed
Add method to UserFactory for admin role assignment
1 parent 2595a5d commit bbdbb11

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

database/factories/UserFactory.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ public function unverified(): static
4141
);
4242
}
4343

44+
public function withAdminRole(): static
45+
{
46+
return $this->state(
47+
fn(array $attributes) => [
48+
'role' => 'admin'
49+
]
50+
);
51+
}
52+
4453
public function withTwoFactor(): static
4554
{
4655
return $this->state(

0 commit comments

Comments
 (0)