@extends('layouts.admin') @php $labels = match(app()->getLocale()) { 'en' => [ 'title' => 'Customer discounts', 'description' => 'Set one discount percentage for each approved customer. It applies automatically to every product.', 'search_placeholder' => 'Name, username or email', 'search' => 'Search', 'customer' => 'Customer', 'account' => 'Account', 'discount' => 'Discount percentage', 'save' => 'Save discount', 'empty' => 'No approved customers found.', ], 'es' => [ 'title' => 'Descuentos de clientes', 'description' => 'Establezca un porcentaje para cada cliente aprobado. Se aplica automáticamente a todos los productos.', 'search_placeholder' => 'Nombre, usuario o correo', 'search' => 'Buscar', 'customer' => 'Cliente', 'account' => 'Cuenta', 'discount' => 'Porcentaje de descuento', 'save' => 'Guardar descuento', 'empty' => 'No hay clientes aprobados.', ], 'tr' => [ 'title' => 'Müşteri indirimleri', 'description' => 'Onaylı her müşteri için tek bir indirim oranı belirleyin. Tüm ürünlere otomatik uygulanır.', 'search_placeholder' => 'Ad, kullanıcı adı veya e-posta', 'search' => 'Ara', 'customer' => 'Müşteri', 'account' => 'Hesap', 'discount' => 'İndirim oranı', 'save' => 'İndirimi kaydet', 'empty' => 'Onaylı müşteri bulunamadı.', ], 'it' => [ 'title' => 'Sconti clienti', 'description' => 'Imposta una percentuale per ogni cliente approvato. Si applica automaticamente a tutti i prodotti.', 'search_placeholder' => 'Nome, utente o email', 'search' => 'Cerca', 'customer' => 'Cliente', 'account' => 'Account', 'discount' => 'Percentuale di sconto', 'save' => 'Salva sconto', 'empty' => 'Nessun cliente approvato.', ], default => [ 'title' => 'خصومات العملاء', 'description' => 'حدد نسبة خصم واحدة لكل عميل معتمد، وستُطبّق تلقائيًا على جميع المنتجات.', 'search_placeholder' => 'الاسم أو اسم المستخدم أو البريد', 'search' => 'بحث', 'customer' => 'العميل', 'account' => 'الحساب', 'discount' => 'نسبة الخصم', 'save' => 'حفظ الخصم', 'empty' => 'لا يوجد عملاء معتمدون.', ], }; @endphp @section('title', $labels['title']) @push('styles') .discount-notice { padding: 14px 16px; margin-bottom: 18px; border-radius: 9px; color: #0756a3; background: #eaf3fc; line-height: 1.7; } .discount-search { display: flex; gap: 9px; margin-bottom: 20px; } .discount-search input { flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid #d0d9e4; border-radius: 8px; font: inherit; } .discount-table-wrap { overflow-x: auto; } .discount-table { width: 100%; border-collapse: collapse; } .discount-table th, .discount-table td { padding: 13px; border-bottom: 1px solid #e4e7ec; text-align: start; vertical-align: middle; } .discount-table th { color: #0756a3; background: #f5f8fb; } .discount-form { display: flex; gap: 8px; align-items: center; min-width: 270px; } .discount-input { width: 100px; padding: 9px 10px; border: 1px solid #d0d9e4; border-radius: 7px; font: inherit; } .muted { color: #667085; font-size: 13px; } @endpush @section('content') @if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
@endif
{{ $labels['description'] }}
@forelse($customers as $customer) @empty @endforelse
{{ $labels['customer'] }} {{ $labels['account'] }} {{ $labels['discount'] }}
{{ $customer->full_name }}
{{ $customer->email }}
{{ $customer->username }}
{{ $customer->account_type }} — {{ $customer->preferred_currency }}
@csrf @method('PATCH') %
{{ $labels['empty'] }}
{{ $customers->links() }}
@endsection