ldc-le-gaulois-pro/app/Http/Requests/Bo/UpdateChangeOrderRequest.php

43 lines
819 B
PHP
Raw Permalink Normal View History

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