37 lines
927 B
PHP
37 lines
927 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Requests\Back;
|
||
|
|
|
||
|
|
use Illuminate\Foundation\Http\FormRequest;
|
||
|
|
|
||
|
|
class ModelListRequest extends FormRequest
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Determine if the user is authorized to make this request.
|
||
|
|
*
|
||
|
|
* @return boolean
|
||
|
|
*/
|
||
|
|
public function authorize(): bool
|
||
|
|
{
|
||
|
|
return auth('backend')->check() and $this->ajax();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Get the validation rules that apply to the request.
|
||
|
|
*
|
||
|
|
* @return array
|
||
|
|
*/
|
||
|
|
public function rules(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'model' => 'required|string|between:3,255|not_in:users',
|
||
|
|
'selectedId' => 'nullable|numeric',
|
||
|
|
'field' => 'nullable|string|between:3,255',
|
||
|
|
'search' => 'nullable|string|max:255',
|
||
|
|
'exclude' => 'nullable|numeric',
|
||
|
|
'page' => 'required|numeric|min:1',
|
||
|
|
'pageSize' => 'required|numeric|min:1',
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|