2025-12-15 15:02:27 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Requests\Back;
|
|
|
|
|
|
2026-01-27 16:48:50 +01:00
|
|
|
use App\Traits\Requests\Api\HasLaravelFailedValidation;
|
2025-12-15 15:02:27 +01:00
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
|
|
|
|
|
class ModelListRequest extends FormRequest
|
|
|
|
|
{
|
2026-01-27 16:48:50 +01:00
|
|
|
use HasLaravelFailedValidation;
|
2026-02-10 15:43:47 +01:00
|
|
|
|
2025-12-15 15:02:27 +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 [
|
2026-01-27 16:48:50 +01:00
|
|
|
'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',
|
2025-12-15 15:02:27 +01:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|