diff --git a/database/factories/PlanFactory.php b/database/factories/PlanFactory.php new file mode 100755 index 0000000..697e274 --- /dev/null +++ b/database/factories/PlanFactory.php @@ -0,0 +1,51 @@ + + */ +class PlanFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + $faker = \Faker\Factory::create(); + $this->faker->addProvider(new Restaurant($faker)); + + $typeBody = [ + 'fit' => $this->faker->boolean(), + 'slim' => $this->faker->boolean(), + 'behavior' => $this->faker->boolean(), + 'wellness' => $this->faker->boolean(), + ]; + + $packetsOptions = [ + 'items' => [$this->faker->fruitName(), $this->faker->meatName(), $this->faker->sauceName()], + 'price' => $this->faker->randomNumber(), + 'short' => $this->faker->foodName(), + 'description' => $this->faker->text(), + ]; + + return [ + 'name' => $this->faker->foodName(), + // 'image' => $this->faker->image('application/storage/fake_images', 640, 480, null, false), + 'image' => storage_path('public/img/Photo_C.png'), + 'duration' => $this->faker->randomElement([7, 14,21]), + 'state' => $this->faker->randomElement(['active', 'draft', 'archived']), + 'type' => $typeBody, + 'details' => $this->faker->text(), + 'packets_count' => $this->faker->randomElement([1, 3]), + 'packet1_options' => $packetsOptions, + 'packet2_options' => $packetsOptions, + 'packet3_options' => $packetsOptions, + ]; + } +} diff --git a/database/seeders/PlanTablesSeeder.php b/database/seeders/PlanTablesSeeder.php new file mode 100755 index 0000000..184b2b0 --- /dev/null +++ b/database/seeders/PlanTablesSeeder.php @@ -0,0 +1,19 @@ +count(10)->create(); + } +}