2022-08-12 22:07:59 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Database\Factories;
|
|
|
|
|
2023-02-17 18:57:11 +01:00
|
|
|
use App\Gender;
|
2022-08-12 22:07:59 +02:00
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
|
|
|
|
/**
|
2023-02-17 18:57:11 +01:00
|
|
|
* @extends Factory<Gender>
|
2022-08-12 22:07:59 +02:00
|
|
|
*/
|
|
|
|
class GenderFactory extends Factory
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Define the model's default state.
|
|
|
|
*
|
|
|
|
* @return array<string, mixed>
|
|
|
|
*/
|
|
|
|
public function definition()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'name' => $this->faker->words(3, true),
|
|
|
|
'nami_id' => $this->faker->numberBetween(100, 200),
|
|
|
|
];
|
|
|
|
}
|
2022-11-19 00:09:53 +01:00
|
|
|
|
|
|
|
public function name(string $name): self
|
|
|
|
{
|
|
|
|
return $this->state(['name' => $name]);
|
|
|
|
}
|
|
|
|
|
2024-06-12 00:04:13 +02:00
|
|
|
public function male(): self
|
|
|
|
{
|
|
|
|
return $this->name('Männlich');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function female(): self
|
|
|
|
{
|
|
|
|
return $this->name('Weiblich');
|
|
|
|
}
|
|
|
|
|
2022-11-19 00:09:53 +01:00
|
|
|
public function inNami(int $namiId): self
|
|
|
|
{
|
|
|
|
return $this->state(['nami_id' => $namiId]);
|
|
|
|
}
|
2022-08-12 22:07:59 +02:00
|
|
|
}
|