39 lines
782 B
PHP
39 lines
782 B
PHP
<?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)
|
|
],
|
|
];
|
|
}
|
|
}
|