<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UpdateReleaseNote extends ReleaseNoteRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    #[\Override]
    public function rules(): array
    {
        return [
            'is_published' => 'present',
            'title' => 'required',
            'content' => 'required',
            'published_at' => ['nullable', 'date', 'required_if:is_published,true'],
        ];
    }
}
