*/ class EventCategoryFactory extends Factory { protected $model = \App\Containers\Event\Models\EventCategory::class; /** * Define the model's default state. * * @return array */ public function definition(): array { $wordCount = rand(1, 3); $title = $this->faker->words($wordCount, true); // true объединяет слова в строку $slug = Str::slug($title); return [ 'title' => $title, 'slug' => $slug, ]; } }