Files
dockergprompt/app/Http/Requests/AiProvider/StoreAiProviderRequest.php
2026-09-01 09:22:30 -03:00

38 lines
1.1 KiB
PHP
Executable File

<?php
declare(strict_types=1);
namespace App\Http\Requests\AiProvider;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class StoreAiProviderRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255', Rule::unique('ai_providers', 'name')->whereNull('deleted_at')],
'slug' => ['required', 'string', 'max:255', Rule::unique('ai_providers', 'slug')->whereNull('deleted_at')],
'description' => ['nullable', 'string'],
'api_key' => ['required', 'string', 'max:255'],
'base_url' => ['required', 'url', 'max:255'],
'is_active' => ['boolean'],
'config' => ['nullable', 'array'],
];
}
}