ldc-legaulois/app/Http/Requests/Bo/UpdateChangeOrderRequest.php

37 lines
735 B
PHP
Raw Permalink Normal View History

2024-01-10 14:49:46 +01:00
<?php
namespace App\Http\Requests\Bo;
use Illuminate\Foundation\Http\FormRequest;
class UpdateChangeOrderRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return auth()->check();
}
/**
* Prepare the data for validation.
*/
protected function prepareForValidation(): void
{
$this->merge([
2026-09-25 16:25:31 +02:00
'direction' => $this->route('direction') === 'up' ? true : false,
2024-01-10 14:49:46 +01:00
]);
}
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
return [
'direction' => 'required|boolean',
];
}
}