<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StoreSmsProfileRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()?->can('manage-settings') ?? false;
    }

    public function rules(): array
    {
        return [
            'name' => ['required', 'string', 'max:190'],
            'active' => ['sometimes', 'boolean'],
            'api_username' => ['required', 'string', 'max:190'],
            'api_password' => ['required', 'string', 'max:500'],
        ];
    }
}
