user affiliation schema completed
This commit is contained in:
33
backend/app/Http/Requests/IndexUserAffiliationRequest.php
Normal file
33
backend/app/Http/Requests/IndexUserAffiliationRequest.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user