*/ final class IngredientFactory extends Factory { /** * The name of the factory's corresponding model. * * @var string */ protected $model = Ingredient::class; /** * Define the model's default state. * * @return array */ public function definition(): array { return [ 'user_id' => fake()->randomElement(User::pluck('id')), 'name' => fake()->word, 'supplier' => fake()->word, 'origin' => \collect(OriginEnum::toArray())->random()->value, 'is_sample' => fake()->boolean, 'family' => \collect(FamilyEnum::toArray())->random()->value, 'packing' => fake()->word, 'function' => fake()->word, 'observation' => fake()->word, 'picture' => fake()->word, 'url' => fake()->url, 'documents' => [fake()->word], 'fair' => fake()->word, 'deleted_at' => fake()->dateTime(), ]; } }