@extends('layouts.app') @section('title', __('AI Settings')) @section('page-title', __('AI Settings')) @section('page-subtitle', __('Pick the LLM provider that powers analyses and translations.')) @section('content') @include('super-admin._nav') @php $provider = old('provider', $activeProvider); $brand = [ 'openai' => ['name' => 'OpenAI', 'mark' => 'AI', 'color' => '#10a37f', 'docs' => 'platform.openai.com'], 'anthropic' => ['name' => 'Anthropic Claude', 'mark' => 'An', 'color' => '#d97757', 'docs' => 'console.anthropic.com'], 'gemini' => ['name' => 'Google Gemini', 'mark' => 'Gm', 'color' => '#4285f4', 'docs' => 'aistudio.google.com'], ]; @endphp
@csrf {{-- Provider selector + master enable --}}

{{ __('Active provider') }}

{{ __('All AI calls (analysis, translations) route through the selected provider. Saved keys for the others are kept and can be activated anytime.') }}

@foreach($providers as $key => $label) @php $b = $brand[$key]; @endphp @endforeach
@error('provider')

{{ $message }}

@enderror
{{-- ─── OpenAI card ─────────────────────────────────────── --}}
AI

{{ __('OpenAI') }}

{{ __('Get your API key at platform.openai.com') }}

{{ __('Stored encrypted. Leave blank to keep the current value.') }}

@error('openai_key')

{{ $message }}

@enderror
{{-- ─── Anthropic card ──────────────────────────────────── --}}
An

{{ __('Anthropic Claude') }}

{{ __('Get your API key at console.anthropic.com') }}

{{ __('Stored encrypted. Leave blank to keep the current value.') }}

@error('anthropic_key')

{{ $message }}

@enderror
{{-- ─── Gemini card ─────────────────────────────────────── --}}
Gm

{{ __('Google Gemini') }}

{{ __('Get your API key at aistudio.google.com') }}

{{ __('Stored encrypted. Leave blank to keep the current value.') }}

@error('gemini_key')

{{ $message }}

@enderror
{{-- Sidebar column placeholder kept inside the outer grid for layout, but the actual test forms must sit OUTSIDE the main below. --}}
{{-- Test connection — separate forms outside the main settings form so their hidden provider inputs do not bleed into the save submission. --}}

{{ __('Test connection') }}

{{ __('Pings the provider with the saved key.') }}

@foreach($providers as $key => $label)
@csrf
@endforeach
@endsection