<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UpdateTranslationsRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()?->role === 'business_owner' || $this->user()?->role === 'super_admin';
    }

    public function rules(): array
    {
        return [
            'translations' => ['required', 'array'],
            'translations.*' => ['nullable', 'string', 'max:5000'],
        ];
    }
}
