Add syncPropValues method to Propable trait; update StoreProductRequest and UpdateProductRequest to handle props validation
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Domains\Product\Requests;
|
||||
|
||||
use App\Domains\Product\Models\Product;
|
||||
use App\Domains\Prop\Support\PropRules;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
@@ -33,6 +34,7 @@ class UpdateProductRequest extends FormRequest
|
||||
'nombre' => ['required', 'string', 'max:255'],
|
||||
'descripcion' => ['nullable', 'string'],
|
||||
'precio' => ['required', 'numeric', 'min:0'],
|
||||
...PropRules::sync(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user