fix: update stock validation to be conditionally required based on request method
This commit is contained in:
parent
486d626ca2
commit
959c01b6bc
@ -40,7 +40,7 @@ public function rules(): array
|
||||
'images.*' => ['image', 'max:5120'],
|
||||
'delete_image_ids' => ['nullable', 'array'],
|
||||
'delete_image_ids.*' => ['integer'],
|
||||
'stock' => ['required', 'integer', 'min:0'],
|
||||
'stock' => [Rule::requiredIf($this->isMethod('post')), 'integer', 'min:0'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user