Update StoreCategoryRequest to require tenant_code only when categoria_id is present
This commit is contained in:
@@ -18,7 +18,7 @@ class StoreCategoryRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'tenant_code' => ['required', 'string', 'exists:tenants,codigo'],
|
||||
'tenant_code' => ['required_with:categoria_id', 'string', 'exists:tenants,codigo'],
|
||||
'categoria_id' => ['nullable', 'integer', 'exists:categorias,id'],
|
||||
'nombre' => ['required', 'string', 'max:255'],
|
||||
...PropRules::sync(),
|
||||
|
||||
Reference in New Issue
Block a user