*/ final class SliderFactory extends Factory { /** * The name of the factory's corresponding model. * * @var string */ protected $model = Slider::class; /** * Define the model's default state. * * @return array */ public function definition(): array { $linkBoolean = fake()->boolean(75); $statusBoolean = fake()->boolean(75); return [ 'type' => \collect(TypeEnum::cases())->random(), 'title' => fake()->unique()->word, 'subtitle' => fake()->word, 'description' => fake()->text, 'link' => ($linkBoolean) ? fake()->url : null, 'link_title' => ($linkBoolean) ? fake()->word : null, 'link_new_tab' => ($linkBoolean) ? fake()->boolean : false, 'picture_alt' => fake()->word, 'picture_title' => fake()->word, 'status' => $statusBoolean, 'unpublish_at' => null, 'publish_at' => ($statusBoolean) ? fake()->dateTime() : null, ]; } }