<?php

declare(strict_types=1);

namespace App\Http\Requests\Comment;

use Illuminate\Foundation\Http\FormRequest;

class StoreCommentRequest extends FormRequest
{
  public function authorize(): bool
  {
    return true;
  }

  public function rules(): array
  {
    return [
      'commentable_type' => ['required', 'string', 'max:255'],
      'commentable_id' => ['required', 'integer', 'min:1'],
      'body' => ['required', 'string', 'min:2', 'max:2000'],
      'category' => ['nullable', 'string', 'max:80'],
      'parent_id' => ['nullable', 'integer', 'exists:comments,id'],
      'media_item_id' => ['nullable', 'integer', 'exists:media_items,id'],
    ];
  }
}
