ldc-lionor/app/Http/Requests/Bo/ChangeOrderRequest.php

43 lines
794 B
PHP
Raw Permalink Normal View History

2023-02-24 15:20:58 +00:00
<?php
namespace App\Http\Requests\Bo;
use Illuminate\Foundation\Http\FormRequest;
class ChangeOrderRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return boolean
*/
public function authorize()
{
return auth('backend')->check();
}
/**
* Prepare the data for validation.
*
* @return void
*/
protected function prepareForValidation()
{
$this->merge([
2024-09-06 08:30:55 +00:00
'direction' => $this->direction === 'up' ? true : false
2023-02-24 15:20:58 +00:00
]);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'direction' => 'required|boolean',
];
}
}