Files
dyncoll-dev/backend/app/Http/Requests/IndexUserRequest.php
Giuseppe Naponiello cc4e174880 auth tests
2026-06-22 14:31:44 +02:00

32 lines
788 B
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
/**
* Validazione dei filtri di query per l'elenco utenti (area admin).
* L'autorizzazione è demandata ai middleware di rotta (auth + admin + setup).
*/
class IndexUserRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
/**
* @return array<string, mixed>
*/
public function rules(): array
{
return [
'search' => ['nullable', 'string', 'max:255'],
'role_id' => ['nullable', 'integer', 'exists:user_roles,id'],
'trashed' => ['nullable', Rule::in(['with', 'only'])],
'per_page' => ['nullable', 'integer', 'min:1', 'max:100'],
];
}
}