ldc-groupe/app/Http/Requests/Back/ModelListRequest.php

41 lines
1.1 KiB
PHP
Raw Permalink Normal View History

<?php
namespace App\Http\Requests\Back;
use App\Traits\Requests\Api\HasLaravelFailedValidation;
use Illuminate\Foundation\Http\FormRequest;
class ModelListRequest extends FormRequest
{
use HasLaravelFailedValidation;
2026-02-10 15:43:47 +01:00
/**
* 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',
'selectedIds' => 'nullable|array',
'selectedIds.*' => 'required|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',
];
}
}