*/ class CmsBrandFactory extends Factory { protected $model = CmsBrand::class; public function definition(): array { $name = fake()->unique()->company(); return [ 'slug' => Str::slug($name).'-'.fake()->unique()->numberBetween(100, 999), 'name' => ['de' => $name, 'en' => $name], 'tagline' => ['de' => fake()->sentence(4), 'en' => fake()->sentence(4)], 'teaser' => ['de' => fake()->paragraph(2), 'en' => fake()->paragraph(2)], 'description' => ['de' => '
'.fake()->paragraph(4).'
', 'en' => ''.fake()->paragraph(4).'
'], 'logo' => '', 'image' => '', 'services' => [ ['title' => fake()->words(3, true), 'description' => fake()->sentence(10)], ['title' => fake()->words(3, true), 'description' => fake()->sentence(10)], ], 'gallery' => [], 'website_url' => fake()->url(), 'showroom' => 'Bielefeld', 'is_published' => true, 'order' => fake()->numberBetween(1, 20), ]; } /** * Galerie mit realisierten Projekten und Inspirationen. */ public function withGallery(int $projects = 2, int $inspirations = 2): static { $items = []; for ($i = 1; $i <= $projects; $i++) { $items[] = [ 'image' => 'projekt-'.$i.'.webp', 'category' => CmsBrand::GALLERY_PROJECT, 'caption' => 'Projekt '.$i, ]; } for ($i = 1; $i <= $inspirations; $i++) { $items[] = [ 'image' => 'inspiration-'.$i.'.webp', 'category' => CmsBrand::GALLERY_INSPIRATION, 'caption' => 'Inspiration '.$i, ]; } return $this->state(fn () => ['gallery' => $items]); } public function unpublished(): static { return $this->state(fn () => ['is_published' => false]); } }