Initial commit: Import existing Laravel project
This commit is contained in:
40
app/Http/Requests/UpdateOrderRequest.php
Normal file
40
app/Http/Requests/UpdateOrderRequest.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateOrderRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
$order = $this->route('commande');
|
||||
return $this->user()->can('update', $order);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user