<?php

namespace App\Http\Requests\Roles;

use App\Http\Requests\ApiFormRequest;

class AssignUserRolesRequest extends ApiFormRequest
{
    public function authorize(): bool
    {
        return auth()->check();
    }

    public function rules(): array
    {
        return [
            'role_ids' => ['nullable', 'array'],
            'role_ids.*' => ['integer', 'min:1', 'exists:roles,id'],
        ];
    }
}
