<?php

declare(strict_types=1);

namespace App\Http\Requests\Artworks;

use Illuminate\Foundation\Http\FormRequest;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

final class ArtworkTagsStoreRequest extends FormRequest
{
    public function authorize(): bool
    {
        if (! $this->user()) {
            throw new NotFoundHttpException();
        }

        return true;
    }

    public function rules(): array
    {
        return [
            'tags' => 'required|array|max:15',
            'tags.*' => 'required|string|max:64',
        ];
    }
}
