new funcionality
This commit is contained in:
@@ -42,4 +42,16 @@ class UserFactory extends Factory
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* approved_at es nullable sin default (ver migración add_approved_at):
|
||||
* un usuario recién creado por el factory queda "pendiente" (isPending()
|
||||
* === true) salvo que se pida explícitamente este estado.
|
||||
*/
|
||||
public function approved(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'approved_at' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user