Files
dyncoll-dev/backend/app/Http/Requests/IndexUserAffiliationRequest.php
2026-06-24 16:30:21 +02:00

34 lines
963 B
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class IndexUserAffiliationRequest extends FormRequest
{
/**
* L'autorizzazione è gestita dal middleware di rotta (tier.app).
*/
public function authorize(): bool
{
return true;
}
/**
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'institution_id' => ['nullable', 'integer', 'exists:institutions,id'],
'user_id' => ['nullable', 'integer', 'exists:users,id'],
'user_position_id' => ['nullable', 'integer', 'exists:user_positions,id'],
'open' => ['nullable', 'boolean'],
'trashed' => ['nullable', Rule::in(['with', 'only'])],
'per_page' => ['nullable', 'integer', 'min:1', 'max:100'],
];
}
}