2022-03-20 16:33:56 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Database\Factories\Member;
|
|
|
|
|
|
|
|
use App\Group;
|
|
|
|
use App\Member\Membership;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @extends Factory<Membership>
|
|
|
|
*/
|
|
|
|
class MembershipFactory extends Factory
|
|
|
|
{
|
|
|
|
public $model = Membership::class;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
|
|
|
* @return array<string, mixed>
|
|
|
|
*/
|
|
|
|
public function definition()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'group_id' => Group::factory()->createOne()->id,
|
|
|
|
'from' => now()->subMonths(3),
|
|
|
|
];
|
|
|
|
}
|
2022-10-30 16:10:21 +01:00
|
|
|
|
|
|
|
public function inNami(int $namiId): self
|
|
|
|
{
|
|
|
|
return $this->state(['nami_id' => $namiId]);
|
|
|
|
}
|
2022-03-20 16:33:56 +01:00
|
|
|
}
|