Add Name to MemberFactory

This commit is contained in:
philipp lang 2025-06-13 15:48:18 +02:00
parent aa55b56df7
commit 878de3f566
1 changed files with 6 additions and 0 deletions

View File

@ -98,6 +98,12 @@ class MemberFactory extends Factory
return $this->state(['nami_id' => null]);
}
public function name(string $name): self
{
[$firstname, $lastname] = explode(' ', $name);
return $this->state(compact('firstname', 'lastname'));
}
public function withBankAccount(BankAccountFactory $factory): self
{
return $this->afterCreating(function ($member) use ($factory) {