@extends('admin.layouts.app') @section('title', __('View Category')) @section('breadcrumb') @endsection @section('page-header')

{{ $category->name }}

{{ __('Category Details and Management') }}

{{ __('Edit Category') }} {{ __('Back to Categories') }}
@endsection @push('styles') @endpush @section('content')
{{-- Main Category Information --}}
{{-- Category Overview --}}
{{ __('Category Overview') }}

{{ $category->name }}

{{ $category->is_active ? __('Active') : __('Inactive') }} {{ $category->code }} {{ __('Order') }}: {{ $category->sort_order }}
@if($category->description)

{{ $category->description }}

@endif
{{-- Hierarchy Information --}} @if($category->parent || $category->children->count() > 0)
{{ __('Category Hierarchy') }}
@if($category->parent)
{{ __('Parent Category') }}:
{{ $category->parent->name }}
@endif @if($category->children->count() > 0)
{{ __('Subcategories') }} ({{ $category->children->count() }}):
@foreach($category->children as $child) {{ $child->name }} @endforeach
@endif
@endif
@if($category->image) {{ $category->name }} @else
@endif
{{-- Translations --}}
{{ __('Translations & SEO') }}
@foreach(config('laravellocalization.supportedLocales') as $localeCode => $locale) @php $translation = $category->translateOrNew($localeCode); $seoScore = 0; if ($translation->exists) { // Calculate basic SEO score if ($translation->meta_title && strlen($translation->meta_title) >= 30 && strlen($translation->meta_title) <= 60) $seoScore += 35; elseif ($translation->meta_title) $seoScore += 17; if ($translation->meta_description && strlen($translation->meta_description) >= 120 && strlen($translation->meta_description) <= 160) $seoScore += 30; elseif ($translation->meta_description) $seoScore += 15; if ($translation->meta_keywords) { $keywords = explode(',', $translation->meta_keywords); if (count($keywords) >= 3 && count($keywords) <= 5) $seoScore += 20; elseif (count($keywords) > 0) $seoScore += 10; } if ($translation->name && strlen($translation->name) >= 5 && strlen($translation->name) <= 50) $seoScore += 15; elseif ($translation->name) $seoScore += 7; } @endphp
{{ $locale['native'] }}
@if($translation->exists) SEO: {{ $seoScore }}/100 @else {{ __('Missing') }} @endif
@if($translation->exists)
{{ __('Name') }}:
{{ $translation->name }}
@if($translation->description)
{{ __('Description') }}:
{{ $translation->description }}
@endif
{{ __('URL Slug') }}:
{{ $translation->slug }}
@if($translation->meta_title)
{{ __('Meta Title') }}:
{{ $translation->meta_title }}
@endif @if($translation->meta_description)
{{ __('Meta Description') }}:
{{ $translation->meta_description }}
@endif @if($translation->meta_keywords)
{{ __('Keywords') }}:
@foreach(explode(',', $translation->meta_keywords) as $keyword) {{ trim($keyword) }} @endforeach
@endif
@else

{{ __('Translation not available for this language') }}

@endif
@endforeach
{{-- Category Products --}} @if($category->products->count() > 0)
{{ __('Products in this Category') }} ({{ $category->products->count() }})
@foreach($category->products->take(6) as $product)
@if($product->images->first()) {{ $product->name }} @else
@endif
{{ $product->name }}
${{ number_format($product->price, 2) }} @if($product->sale_price) ${{ number_format($product->sale_price, 2) }} @endif
{{ $product->sku }}
@endforeach
@if($category->products->count() > 6) @endif
@endif
{{-- Sidebar --}}
{{-- Quick Stats --}}
{{ __('Quick Statistics') }}

{{ $category->products->count() }}

{{ __('Products') }}

{{ $category->children->count() }}

{{ __('Subcategories') }}
{{-- Category Actions --}}
{{ __('Category Actions') }}
{{ __('Edit Category') }} @if($category->products->count() === 0 && $category->children->count() === 0) @endif
{{-- Category Information --}}
{{ __('Category Information') }}
{{ __('Code') }}: {{ $category->code }}
{{ __('Sort Order') }}: {{ $category->sort_order }}
{{ __('Created') }}: {{ $category->created_at->format('M d, Y') }}
{{ __('Last Updated') }}: {{ $category->updated_at->format('M d, Y') }}
{{ __('Default Locale') }}: {{ strtoupper($category->default_locale) }}
{{-- Delete Confirmation Modal --}} @endsection @push('scripts') @endpush