{{-- resources/views/admin/stores/index.blade.php - النسخة المحسنة بدون تضارب --}} @extends('admin.layouts.app') @section('title', admin_trans('stores')) @section('page-title', admin_trans('stores')) @section('content')
@if(request('locale_id'))@endif @if(request('status'))@endif @if(request('featured'))@endif
@if($currentCountry && $availableLocales->count() > 1)
@if(request('search'))@endif @if(request('status'))@endif @if(request('featured'))@endif
@endif
@if(request('search'))@endif @if(request('locale_id'))@endif @if(request('featured'))@endif
@if(request('search'))@endif @if(request('locale_id'))@endif @if(request('status'))@endif
@if(request()->hasAny(['search', 'locale_id', 'status', 'featured'])) {{ admin_trans('clear_filters') }} @endif
{{ admin_trans('add_store') }}
{{ admin_trans('activate') }} {{ admin_trans('deactivate') }} {{ admin_trans('feature') }} {{ admin_trans('unfeature') }} {{ admin_trans('delete') }} {{ admin_trans('clear') }}
@if ($stores->isEmpty()) @if($currentCountry) {{ admin_trans('add_store') }} @else

{{ admin_trans('use_country_filter_navbar') }}

@endif @else @foreach ($stores as $store) @php $countryStore = $currentCountry ? $store->countryStores->where('country_id', $currentCountry->id)->first() : $store->countryStores->first(); $translation = $store->translations->first(); @endphp
{{ $countryStore->order ?? 0 }}
@if ($store->getFirstMediaUrl('logo')) Logo @else
@endif
{{ $translation->name ?? 'Store #' . $store->id }} @if ($translation && $translation->description)
{{ Str::limit(strip_tags($translation->description), 50) }}
@endif
{{ $store->user->name ?? 'N/A' }}
{{ $store->user->email ?? '' }}
@foreach($store->translations->take(3) as $trans) {{ $trans->locale->code ?? 'N/A' }} @endforeach @if($store->translations->count() > 3) +{{ $store->translations->count() - 3 }} @endif
@if($countryStore && $countryStore->stats)
{{ $countryStore->stats->followers_count ?? 0 }}
{{ $countryStore->stats->views_count ?? 0 }}
{{ $countryStore->stats->uses_count ?? 0 }}
@else - @endif
@if($countryStore)
@csrf @method('PATCH')
@endif
@if($countryStore)
@csrf @method('PATCH') @endif
@endforeach
@if ($stores->hasPages())
@endif @endif

{{ admin_trans('add_store') }}

@if($currentCountry && $availableLocales->count() > 0)
@csrf
{{ $currentCountry->flag_emoji }}

{{ admin_trans('creating_store_for') }}

{{ $currentCountry->getName() }}

@php $usersArray = $users->map(function($user) { return [ 'id' => $user->id, 'name' => $user->name . ' (' . $user->email . ')' ]; })->toArray(); @endphp {{-- Multi-language Content Tabs --}}
@foreach($availableLocales as $locale) @endforeach
@foreach($availableLocales as $locale)
direction === 'rtl') dir="rtl" @endif> {{ admin_trans('description') }}
@endforeach
@foreach($categories as $category) @php $categoryTranslation = $category->translations->first(); $categoryName = $categoryTranslation->name ?? 'Category #' . $category->id; @endphp @endforeach
{{ admin_trans('cancel') }} {{ admin_trans('create') }}
@else {{ admin_trans('close') }} @endif

{{ admin_trans('edit_store') }}

@csrf @method('PUT')
{{ admin_trans('select_owner') }}
{{ admin_trans('no_results_found') }}
@if($availableLocales->count() > 0)
@foreach($availableLocales as $locale) @endforeach
@foreach($availableLocales as $locale) @php $translation = isset($store) ? $store->translations->where('locale_id', $locale->id)->first() : null; $isRTL = $locale->direction === 'rtl'; @endphp
{{ admin_trans('description') }}
@endforeach
@endif
@foreach($categories as $category) @php $categoryTranslation = $category->translations->first(); $categoryName = $categoryTranslation->name ?? 'Category #' . $category->id; @endphp @endforeach
Logo
{{ admin_trans('cancel') }} {{ admin_trans('update') }}

{{ admin_trans('store_statistics') }}

{{ admin_trans('followers') }}

{{ admin_trans('views') }}

{{ admin_trans('uses') }}

{{ admin_trans('impressions') }}

{{ admin_trans('popularity_score') }}

{{ admin_trans('max_discount') }}

%

{{ admin_trans('avg_discount') }}

%

{{ admin_trans('last_offer_added') }}

{{ admin_trans('last_usage') }}

@endsection @push('scripts') @endpush