| 12345678910111213141516171819202122232425262728293031 |
- <?php
- namespace App\Http\Requests;
- use Illuminate\Foundation\Http\FormRequest;
- class StoreReclamationSparePartsRequest extends FormRequest
- {
- /**
- * Determine if the user is authorized to make this request.
- */
- public function authorize(): bool
- {
- return hasRole('admin,manager');
- }
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array
- */
- public function rules(): array
- {
- return [
- 'rows' => 'nullable|array',
- 'rows.*.spare_part_id' => 'nullable|integer|exists:spare_parts,id',
- 'rows.*.quantity' => 'nullable|integer|min:0',
- 'rows.*.with_documents' => 'nullable',
- ];
- }
- }
|