<?php

declare(strict_types=1);

namespace App\Http\Requests\Collections;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'artwork_ids' => ['required', 'array', 'min:1'],
            'artwork_ids.*' => ['integer', 'distinct'],
        ];
    }
}
