changed fields key types

This commit is contained in:
2023-12-19 12:35:46 +03:00
parent 9cf91dded5
commit 06409455fd
2 changed files with 5 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ class Create extends Component
'name' => 'required|min:3',
'image' => 'required|image|max:2048',
'duration' => 'required|numeric|min:7',
'state' => 'required|in:draft,active,inactive',
'state' => 'required|in:draft,active,unactive',
'type' => ['required', 'array:slim,fit,wellness,behavior', 'min:1'],
'details' => 'required|min:3',
'packets_count' => 'required|in:1,3',

View File

@@ -30,6 +30,8 @@ class PlanFactory extends Factory
'wellness' => $this->faker->boolean(),
];
$wrongTypeBody = json_encode($typeBody);
$packetsOptions = [
'items' => [$this->faker->fruitName(), $this->faker->meatName(), $this->faker->sauceName()],
'price' => $this->faker->randomNumber(),
@@ -46,7 +48,8 @@ class PlanFactory extends Factory
// 'image' => UploadedFile::fake()->image('plans/Photo_C.png'),
'image' => $fileLocalPath,
'duration' => $this->faker->randomElement([7, 14,21]),
'state' => $this->faker->randomElement(['active', 'draft', 'archived']),
'state' => $this->faker->randomElement(['active', 'draft', 'unactive']),
//'type' => $this->faker->randomElement([$typeBody, $wrongTypeBody]),
'type' => $typeBody,
'details' => $this->faker->text(),
'packets_count' => $this->faker->randomElement([1, 3]),