f83f21936f
API CI/CD / Validate (composer + pint) (push) Successful in 3m30s
API CI/CD / Test (PHPUnit) (push) Failing after 5m4s
API CI/CD / Build frontend assets (push) Successful in 1m1s
API CI/CD / Security audit (push) Failing after 49s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
22 lines
421 B
PHP
22 lines
421 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Roles;
|
|
|
|
use App\Http\Requests\ApiFormRequest;
|
|
|
|
class AssignUserRolesRequest extends ApiFormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return $this->user() !== null;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'role_ids' => ['nullable', 'array'],
|
|
'role_ids.*' => ['integer', 'min:1', 'exists:roles,id'],
|
|
];
|
|
}
|
|
}
|