123 lines
3.8 KiB
PHP
123 lines
3.8 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
use SplFileInfo;
|
|
|
|
class ProductFactory extends Factory
|
|
{
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function definition()
|
|
{
|
|
$name = $this->faker->text(10) . rand(1, 100);
|
|
$tabFour = array(
|
|
'id' => 0,
|
|
'name' => 'Four',
|
|
'url' => '/assets/images/four.png',
|
|
'time' => '1h30mins.',
|
|
'temp' => '200°C',
|
|
'status' => true
|
|
);
|
|
$tabFriteuse = array(
|
|
'id' => 1,
|
|
'name' => 'Friteuse',
|
|
'url' => '/assets/images/friteuse.png',
|
|
'time' => '15 minutes',
|
|
'temp' => '100°C',
|
|
'status' => true
|
|
);
|
|
$tabPoele = array(
|
|
'id' => 2,
|
|
'name' => 'Poêle',
|
|
'url' => '/assets/images/poele.png',
|
|
'time' => '5 minutes sur chaque face',
|
|
'temp' => '100°C',
|
|
'status' => false
|
|
);
|
|
$tabCocotte = array(
|
|
'id' => 3,
|
|
'name' => 'Cocotte',
|
|
'url' => '/assets/images/cocotte.png',
|
|
'time' => '3 h',
|
|
'temp' => '80°C',
|
|
'status' => true
|
|
);
|
|
$tabPlancha = array(
|
|
'id' => 4,
|
|
'name' => 'Plancha',
|
|
'url' => '/assets/images/plancha.png',
|
|
'time' => '20mins',
|
|
'temp' => '130°C',
|
|
'status' => false
|
|
);
|
|
$tabBainMarie = array(
|
|
'id' => 5,
|
|
'name' => 'Bain Marie',
|
|
'url' => '/assets/images/bainmarie.png',
|
|
'time' => '30 mins à 45 mins',
|
|
'temp' => '80°C',
|
|
'status' => false
|
|
);
|
|
$tabBarbecue = array(
|
|
'id' => 6,
|
|
'name' => 'Barbecue',
|
|
'url' => '/assets/images/barbecue.png',
|
|
'time' => '30 minutes',
|
|
'temp' => '200°C',
|
|
'status' => false
|
|
);
|
|
$tabMicroOndes = array(
|
|
'id' => 7,
|
|
'name' => 'Micro Ondes',
|
|
'url' => '/assets/images/microondes.png',
|
|
'time' => '3mins',
|
|
'temp' => '900 Watts',
|
|
'status' => false
|
|
);
|
|
$tabPlusProduit1 = array(
|
|
'id' => 0,
|
|
'name' => 'Lorem ipsum set doloris',
|
|
'url' => '/assets/images/sans-label.jpg',
|
|
);
|
|
$tabPlusProduit2 = array(
|
|
'id' => 1,
|
|
'name' => 'Lorem ipsum set doloris',
|
|
'url' => '/assets/images/sans-label.jpg',
|
|
);
|
|
$tabPlusProduit3 = array(
|
|
'id' => 2,
|
|
'name' => 'Lorem ipsum set doloris',
|
|
'url' => '/assets/images/sans-label.jpg',
|
|
);
|
|
return [
|
|
'name' => $name,
|
|
'slug' => Str::slug($name),
|
|
'description' => $this->faker->paragraph(),
|
|
'picture' => new SplFileInfo(resource_path('assets/images/product_sample_01.png')),
|
|
'alt_text_picture' => $this->faker->sentence(10),
|
|
'pictos' => json_encode([
|
|
'four' => $tabFour,
|
|
'friteuse' => $tabFriteuse,
|
|
'poele' => $tabPoele,
|
|
'cocotte' => $tabCocotte,
|
|
'plancha' => $tabPlancha,
|
|
'bainmarie' => $tabBainMarie,
|
|
'barbecue' => $tabBarbecue,
|
|
'microondes' => $tabMicroOndes
|
|
]),
|
|
'plusproduit' => json_encode([$tabPlusProduit1, $tabPlusProduit2, $tabPlusProduit3]),
|
|
'is_published' => true,
|
|
'is_on_top' => false,
|
|
'is_food_service' => false,
|
|
'is_halal' => true,
|
|
'seo_title' => $this->faker->text(5),
|
|
'seo_description' => $this->faker->sentence(20),
|
|
];
|
|
}
|
|
}
|