<?php

namespace App\Http\Requests\V1\Settings;

use App\Enums\SettingsEnum;
use App\Http\Requests\BaseFormRequest;
use Illuminate\Support\Facades\Gate;
use Illuminate\Validation\Rules\Enum;

// class UpdateSettingRequest extends BaseFormRequest
// {
//     public function authorize(): bool
//     {
//         return Gate::allows('update-settings');
//     }

//     public function rules(): array
//     {
//         return [
//             'name' => ['required', 'string', new Enum(SettingsEnum::class)],
//             'value' => SettingsEnum::getRulesFromValue($this->name),
//         ];
//     }
// }
class UpdateSettingRequest extends BaseFormRequest
{
    public function authorize(): bool
    {
        // return Gate::allows('update-settings');
        return true;
    }

    public function rules(): array
    {
        return [
            'name' => ['required', 'string'],
            'value' => ["required"],
        ];
    }
}
