*/ class ActivityFactory extends Factory { protected $model = Activity::class; /** @var array */ private array $tries = [ 'Schnuppermitgliedschaft', ]; /** @var array */ private array $members = [ '€ Mitglied', 'Schnuppermitgliedschaft', ]; /** @var array */ private array $filterableActivities = [ '€ Mitglied', '€ passive Mitgliedschaft', '€ KassiererIn', '€ LeiterIn', 'Schnuppermitgliedschaft', ]; /** @var array */ private array $efz = [ '€ LeiterIn', ]; /** * Define the model's default state. * * @return array */ public function definition() { return [ 'name' => $this->faker->words(5, true), ]; } public function inNami(int $namiId): self { return $this->state(['nami_id' => $namiId]); } public function name(string $name): self { return $this->state([ 'name' => $name, 'is_try' => in_array($name, $this->tries), 'is_member' => in_array($name, $this->members), 'is_filterable' => in_array($name, $this->filterableActivities), 'has_efz' => in_array($name, $this->efz), ]); } }