Commit c5ffbb01 authored by Artem's avatar Artem

add product factory

parent 91f3860b
......@@ -6,7 +6,17 @@ use App\Product;
use Faker\Generator as Faker;
$factory->define(Product::class, function (Faker $faker) {
static $product_id = 1;
$product_type = [
1 => 'Phone',
2 => 'Balalaika'
];
return [
//
'reference' => 'Product ' . $product_id++,
'description_short' => $faker->sentence,
'description_long' => $faker->paragraph,
'price' => $faker->randomNumber(4),
'type' => $product_type[rand(1, 2)],
];
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment