*/ class AlbumFactory extends Factory { /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'name' => fake()->sentence(2), 'cover' => './covers/image-'.rand(1,12).'-big.jpg', 'category_id' => Category::all()->random(1)->first()->id, ]; } }