<?php

declare(strict_types=1);

namespace App\Http\Requests\Collections;

use Illuminate\Foundation\Http\FormRequest;

class UpdateCollectionLinkedCollectionsRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user() !== null;
    }

    public function rules(): array
    {
        return [
            'related_collection_ids' => ['nullable', 'array', 'max:12'],
            'related_collection_ids.*' => ['required', 'integer', 'distinct'],
        ];
    }
}