fixed item price validation issue

This commit is contained in:
Cihan Şentürk 2024-04-24 18:01:15 +03:00 committed by GitHub
parent fbe33ff83c
commit 5f324502cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -14,7 +14,9 @@ class Item extends FormRequest
*/
public function rules()
{
$picture = $sale_price = $purchase_price = 'nullable';
$picture = 'nullable';
$sale_price = 'nullable|required_without:purchase_price';
$purchase_price = 'nullable|required_without:sale_price';
if ($this->files->get('picture')) {
$picture = 'mimes:' . config('filesystems.mimes')