faker->words(3, true); $slug = Str::slug($name); return [ 'tenant_id' => Tenant::factory(), 'name' => $name, 'slug' => $slug, 'description' => $this->faker->paragraph(), 'date' => $this->faker->dateTimeBetween('now', '+6 months'), 'location' => $this->faker->address(), 'max_participants' => $this->faker->numberBetween(50, 500), 'is_active' => true, 'join_link_enabled' => true, 'photo_upload_enabled' => true, 'task_checklist_enabled' => true, ]; } public function inactive(): static { return $this->state(fn (array $attributes) => [ 'is_active' => false, ]); } public function withTasks(int $count = 3): static { return $this->afterCreating(function (Event $event) use ($count) { $event->tasks()->attach( \App\Models\Task::factory($count)->create(['tenant_id' => $event->tenant_id]) ); }); } public function past(): static { return $this->state(fn (array $attributes) => [ 'date' => $this->faker->dateTimeBetween('-1 month', 'now'), ]); } public function upcoming(): static { return $this->state(fn (array $attributes) => [ 'date' => $this->faker->dateTimeBetween('now', '+1 month'), ]); } }