Add Name to MemberFactory
This commit is contained in:
parent
aa55b56df7
commit
878de3f566
|
@ -98,6 +98,12 @@ class MemberFactory extends Factory
|
||||||
return $this->state(['nami_id' => null]);
|
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
|
public function withBankAccount(BankAccountFactory $factory): self
|
||||||
{
|
{
|
||||||
return $this->afterCreating(function ($member) use ($factory) {
|
return $this->afterCreating(function ($member) use ($factory) {
|
||||||
|
|
Loading…
Reference in New Issue