user()->can('create', \App\Models\Order::class); } /** * Get the validation rules that apply to the request. */ public function rules(): array { return [ 'label' => ['required', 'string', 'max:255'], 'type' => ['required', 'string', 'in:Matériel réseau / serveur,Licences logicielles,Consommables / câblage,Prestations / services'], 'supplier' => ['required', 'string', 'max:255'], 'quote_number' => ['required', 'string', 'max:255'], 'amount_ht' => ['required', 'numeric', 'min:0'], 'exclude_vat' => ['nullable', 'boolean'], 'requested_by' => ['required', 'string', 'in:Jérémy,Sylvain,Kévin'], 'prescriber' => ['required', 'string', 'max:255'], 'delivery_deadline' => ['required', 'date'], 'notes' => ['nullable', 'string'], 'quote_file' => ['nullable', 'file', 'mimes:pdf,png,jpg,jpeg,doc,docx,xls,xlsx', 'max:10240'], 'delivery_note_file' => ['nullable', 'file', 'mimes:pdf,png,jpg,jpeg,doc,docx,xls,xlsx', 'max:10240'], 'invoice_file' => ['nullable', 'file', 'mimes:pdf,png,jpg,jpeg,doc,docx,xls,xlsx', 'max:10240'], ]; } }