first upload all files
This commit is contained in:
24
Modules/Option/Database/Factories/ModelFactory.php
Normal file
24
Modules/Option/Database/Factories/ModelFactory.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
use Modules\Option\Entities\Option;
|
||||
use Modules\Option\Entities\OptionValue;
|
||||
|
||||
$factory->define(OptionValue::class, function (Faker $faker) {
|
||||
return [
|
||||
'option_id' => function () {
|
||||
return factory(Option::class)->create()->id;
|
||||
},
|
||||
'name' => $faker->word(),
|
||||
'price' => $faker->randomNumber(),
|
||||
'price_type' => $faker->randomElement(['fixed', 'percent']),
|
||||
];
|
||||
});
|
||||
|
||||
$factory->define(Option::class, function (Faker $faker) {
|
||||
return [
|
||||
'name' => $faker->word(),
|
||||
'type' => $faker->randomElement(['field', 'dropdown']),
|
||||
'is_required' => $faker->boolean(),
|
||||
];
|
||||
});
|
||||
Reference in New Issue
Block a user