forked from eatvio/eatvio-infra
fix reipe fields cooking_time, steps factory
This commit is contained in:
@@ -1,14 +1,12 @@
|
|||||||
<?php
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Database\Factories;
|
namespace Database\Factories;
|
||||||
|
|
||||||
use Faker\Provider\Youtube;
|
use Faker\Provider\Youtube;
|
||||||
use FakerRestaurant\Provider\en_US\Restaurant;
|
use FakerRestaurant\Provider\en_US\Restaurant;
|
||||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
use Illuminate\Http\UploadedFile;
|
|
||||||
use Illuminate\Http\File;
|
use Illuminate\Http\File;
|
||||||
|
use Illuminate\Http\UploadedFile;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,7 +29,7 @@ class RecipeFactory extends Factory
|
|||||||
'title' => $this->faker->foodName(),
|
'title' => $this->faker->foodName(),
|
||||||
'image' => $this->generateImageFile('recipes'),
|
'image' => $this->generateImageFile('recipes'),
|
||||||
'state' => $this->faker->randomElement(['active', 'archived']),
|
'state' => $this->faker->randomElement(['active', 'archived']),
|
||||||
'cooking_time' => $this->faker->numberBetween(0, 59),
|
'cooking_time' => $this->faker->randomElement(['10', '20', '30', '60', '120', '14400']),
|
||||||
'ingredients' => $this->createQuentityIngredients($this->faker->randomDigitNotNull()), // quentity - от 1 до 10 randomDigitNotNull
|
'ingredients' => $this->createQuentityIngredients($this->faker->randomDigitNotNull()), // quentity - от 1 до 10 randomDigitNotNull
|
||||||
'type' => $this->faker->randomElement(['first_meals', 'second_meals', 'salads', 'snacks', 'drinks', 'other']),
|
'type' => $this->faker->randomElement(['first_meals', 'second_meals', 'salads', 'snacks', 'drinks', 'other']),
|
||||||
'description' => $this->faker->text(),
|
'description' => $this->faker->text(),
|
||||||
@@ -56,7 +54,7 @@ class RecipeFactory extends Factory
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => $this->faker->foodName(),
|
'name' => $this->faker->foodName(),
|
||||||
'unit' => $this->faker->randomElement(['гр', 'ч. ложек', 'cт. ложек', 'мл', 'шт', 'зубчик', 'по вкусу']),
|
'unit' => $this->faker->randomElement(['gr', 'teespons', 'tablespoon', 'ml', 'pcs', 'clove', 'to_taste']),
|
||||||
'portion' => $this->faker->randomNumber(3, true),
|
'portion' => $this->faker->randomNumber(3, true),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user