user()?->role, [Role::ADMIN, Role::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', ]; } }