Files
dyncoll-dev/backend/app/Http/Requests/IndexLicenseRequest.php
Giuseppe Naponiello 271acacb1d
Some checks failed
docs / build (push) Has been cancelled
docs / deploy (push) Has been cancelled
license: built full stack, test and documentation
2026-07-03 12:47:47 +02:00

34 lines
850 B
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class IndexLicenseRequest extends FormRequest
{
/**
* Rotta pubblica: l'elenco delle licenze è informazione pubblica.
*/
public function authorize(): bool
{
return true;
}
/**
* `scope` filtra le select dei form: `record` per artifact/model (solo
* licenze aperte), `media` per i file caricati (tutte). `active` esclude
* le licenze ritirate dagli admin.
*
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'scope' => ['nullable', Rule::in(['record', 'media'])],
'active' => ['nullable', 'boolean'],
];
}
}