Files
KanbanGit/app/Http/Requests/SyncProjectPermissionsRequest.php
T
Eric Peters e0360ab6f0
linter / quality (pull_request) Successful in 1m15s
tests / ci (8.4) (pull_request) Successful in 1m19s
Check if this was not the error
2026-04-04 10:42:50 +02:00

37 lines
874 B
PHP

<?php
namespace App\Http\Requests;
use App\Actions\ProjectPermissions\ProjectPermissionService;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class SyncProjectPermissionsRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return $this->user() !== null;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'permissions' => ['nullable', 'array'],
'permissions.*' => [
'string',
Rule::in(ProjectPermissionService::permissions()),
],
];
}
}