ldc-loue/app/Http/Requests/Bo/ChangeOrderRequest.php
Jérémy Munsch 0751114f4a
BO News, Tags, Sliders
CKeditor + word counter + Image Input + Taggable VUE3
Better Xss Sanitizer
Handle Video Youtube + Image Upload + Inline Image from url
Better Image Input component with reset, easizer resize
Full Responsive BO
2022-06-04 15:55:36 +02:00

43 lines
845 B
PHP

<?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([
'direction' => $this->action === 'up' ? true : false
]);
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'action' => 'required|string|in:up,down',
'direction' => 'required|boolean',
];
}
}