ldc-com-app-bo/app/Http/Requests/Bo/UpdateChangeOrderRequest.php

43 lines
828 B
PHP
Raw Normal View History

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