*/ final class NewsFactory extends Factory { /** * The name of the factory's corresponding model. * * @var string */ protected $model = News::class; /** * Define the model's default state. * * @return array */ public function definition(): array { $title = fake()->word; $locales = \collect(\config('app.locales'))->shuffle(); $locales->shift(\rand(0, 1)); return [ 'seo_title' => fake()->word, 'seo_description' => fake()->text(150), 'title' => $title, 'slug' => Str::slug($title), 'subtitle' => fake()->word, 'content' => fake()->text(150), 'status' => fake()->boolean(), 'locales' => $locales ]; } }