<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StoreHeroCardRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()?->hasRole('Manager') ?? false;
    }

    public function rules(): array
    {
        return [
            'title'            => ['required', 'string', 'max:191'],
            'content'          => ['required', 'string', 'max:2000'],
            'background_color' => ['required', 'string', 'max:50'],
            'order'            => ['nullable', 'integer', 'min:0'],
            'is_active'        => ['nullable', 'boolean'],
        ];
    }
}
