*/ class CompanyFactory extends Factory { protected $model = Company::class; public function definition(): array { $name = fake()->company(); return [ 'portal' => fake()->randomElement([Portal::Presseecho->value, Portal::Businessportal24->value]), 'type' => fake()->randomElement(CompanyType::cases())->value, 'name' => $name, 'slug' => Str::slug($name).'-'.fake()->unique()->numberBetween(1000, 9999), 'address' => fake()->streetAddress(), 'country_code' => 'DE', 'phone' => fake()->phoneNumber(), 'email' => fake()->companyEmail(), 'website' => fake()->url(), 'is_active' => true, ]; } public function presseecho(): static { return $this->state(['portal' => Portal::Presseecho->value]); } public function businessportal24(): static { return $this->state(['portal' => Portal::Businessportal24->value]); } public function inactive(): static { return $this->state(['is_active' => false]); } }