*/ class PlatformChannelFactory extends Factory { protected $model = PlatformChannel::class; public function definition(): array { return [ 'platform_instance_id' => PlatformInstance::factory(), 'channel_id' => $this->faker->slug(2), 'name' => $this->faker->words(2, true), 'display_name' => $this->faker->words(2, true), 'language_id' => Language::factory(), 'description' => $this->faker->optional()->sentence(), 'is_active' => true, ]; } public function inactive(): static { return $this->state(fn (array $attributes) => [ 'is_active' => false, ]); } public function community(string $name = null): static { $communityName = $name ?: $this->faker->word(); return $this->state(fn (array $attributes) => [ 'channel_id' => strtolower($communityName), 'name' => $communityName, 'display_name' => ucfirst($communityName), ]); } }