@extends('client.layouts.app') @section('title', __('messages.services')) @section('styles') @endsection @section('content') @php $locale = strtolower((string) app()->getLocale()); $serviceGroups = $contacts->groupBy(function ($contact) { $service = trim((string) ($contact->service ?? '')); return $service !== '' ? $service : __('messages.service'); }); $quickLinks = collect(json_decode((string) setting('fast_links', '[]'), true)) ->filter(function ($item) { return is_array($item) && trim((string) ($item['title'] ?? '')) !== '' && trim((string) ($item['url'] ?? '')) !== '' && ($item['client_visible'] ?? 'yes') === 'yes'; }) ->values()->take(6); $categoryLabel = function ($category) use ($locale) { if (in_array($locale, ['ar', 'arabic'], true) && !empty($category->name_ar)) return $category->name_ar; if (in_array($locale, ['en', 'english'], true) && !empty($category->name_en)) return $category->name_en; return $category->name ?? '-'; }; $iconClass = function (string $s) { $n = strtolower($s); return match (true) { str_contains($n, 'finance') || str_contains($n, 'payment') => 'fas fa-university', str_contains($n, 'commercial') || str_contains($n, 'sales') => 'fas fa-store', str_contains($n, 'visa') => 'fas fa-globe', str_contains($n, 'hotel') || str_contains($n, 'reservation') => 'fas fa-hotel', str_contains($n, 'billet') || str_contains($n, 'ticket') => 'fas fa-ticket-alt', str_contains($n, 'support') => 'fas fa-headset', default => 'fas fa-briefcase', }; }; @endphp
{{-- Hero ── --}}

{{ __('messages.services') }} — {{ setting('site_name', 'Support') }}

{{ setting('site_description', __('messages.client_new_ticket_subtitle')) }}

{{-- Stats strip ── --}}
{{ $totalTickets }}
{{ __('messages.client_my_tickets') }}
{{ $openTickets }}
{{ __('messages.open_tickets') }}
{{ $contacts->count() }}
{{ __('messages.contact_lists') }}
{{ $categories->count() }}
{{ __('messages.categories') }}
{{-- Offers strip ── --}} @if ($offres->isNotEmpty())
@foreach ($offres as $offre) @php $offerImage = trim((string) ($offre->image_url ?? '')); if ($offerImage === '') { $fb = trim((string) ($offre->image ?? '')); $offerImage = $fb !== '' ? asset('image/offres/' . basename($fb)) : ''; } @endphp
@if ($offerImage !== '') {{ $offre->name ?? 'Offer' }} @endif

{{ $offre->name ?? __('messages.services') }}

@endforeach
@endif {{-- Main 2-col grid ── --}}
{{-- Left: service cards ── --}}
@forelse ($serviceGroups as $serviceName => $group)

{{ $serviceName }}

{{ $group->count() }} {{ $group->count() > 1 ? __('messages.contact_lists') : __('messages.contact_list') }}

@foreach ($group->take(3) as $contact)
@if (!empty($contact->name))
{{ $contact->name }}
@endif @if (!empty($contact->siage))
{{ $contact->siage }}
@endif @if (!empty($contact->phone)) @foreach(explode(',', $contact->phone) as $ph) @if(trim($ph) !== '') @endif @endforeach @endif @if (!empty($contact->email)) @endif
@endforeach
@empty

{{ __('messages.client_no_contacts') }}

@endforelse
{{-- Right: sidebar ── --}}
{{-- Quick links --}}
{{ __('messages.client_quick_links') }}
{{-- Categories --}} @if ($categories->isNotEmpty())
{{ __('messages.categories') }}
@foreach ($categories->take(14) as $category) {{ $categoryLabel($category) }} @endforeach
@endif {{-- Site contact info --}} @if (setting('site_email') || setting('contact_phone'))
{{ __('messages.client_contacts') }}
@if (setting('site_email'))
{{ setting('site_email') }}
@endif @if (setting('contact_phone'))
{{ setting('contact_phone') }}
@endif
@endif
{{-- /svc-grid --}}
{{-- /svc-wrap --}} @endsection