ldc-domaine-de-lanvaux/app/Http/Requests/Bo/UpdateChangeOrderRequest.php

40 lines
782 B
PHP
Raw Permalink Normal View History

2022-08-05 09:38:44 +00:00
<?php
namespace App\Http\Requests\Bo;
use App\Enums\ChangeOrder;
use Kwaadpepper\Enum\Rules\EnumIsValidRule;
use Illuminate\Foundation\Http\FormRequest;
class UpdateChangeOrderRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize(): bool
{
$this->merge([
'action' => $this->action
]);
return auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules(): array
{
return [
'action' => [
'required',
new EnumIsValidRule(ChangeOrder::class)
],
];
}
}