@extends('layouts.app') @section('style') @endsection @section('content')

Total Categories

{{ $stats['total'] ?? 0 }}

{{ $stats['parent_categories'] ?? 0 }} parents

With Products

{{ $stats['with_products'] ?? 0 }}

{{ $stats['total_products'] ?? 0 }} total products

Active Categories

{{ $stats['active'] ?? 0 }}

{{ $stats['inactive'] ?? 0 }} inactive

Archived

{{ $stats['archived'] ?? 0 }}

Soft deleted

@if(request()->has('search')) @endif
@if(request()->anyFilled(['search', 'filter', 'sort_by']))
@if(request()->has('search')) Search: "{{ request('search') }}" @endif @if(request()->has('filter') && request('filter') != '') Filter: {{ ucfirst(str_replace('-', ' ', request('filter'))) }} @endif @if(request()->has('sort_by') && request('sort_by') != '') Sorted by: {{ ucfirst(str_replace('_', ' ', request('sort_by'))) }} @endif
@endif
@if(session('success'))
Success
{{ session('success') }}
@endif @if(session('error'))
Error
{{ session('error') }}
@endif @if($errors->any())
Validation Errors
    @foreach($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @if($categories->count() > 0)
@foreach($categories as $category) @endforeach
Category Description Products Status Actions
deleted_at ? 'disabled' : '' }}>
{{ $category->name }} @if(!$category->is_active) Inactive @endif
@if($category->parent)

Parent: {{ $category->parent->name }}

@else

Main Category

@endif @if(($category->children?->count() ?? 0) > 0)
{{ $category->children->count() }} subcategories: @foreach($category->children as $subcategory)
{{ $subcategory->name }} @if(($subcategory->products_count ?? 0) > 0) {{ $subcategory->products_count }} products @endif
@endforeach
@endif
@if($category->description)

{{ $category->description }}

@else No description @endif
@if(($category->products_count ?? 0) > 0) {{ $category->products_count }} products View Products @else 0 products No products @endif
@if($category->deleted_at) Archived
{{ $category->deleted_at->format('M d, Y') }}
@elseif($category->is_active) Active @else Inactive @endif
@if($category->deleted_at)
@csrf @method('POST')
@csrf @method('DELETE')
@else @if($category->is_active)
@csrf @method('PUT')
@else
@csrf @method('PUT')
@endif
@csrf @method('POST')
@csrf @method('DELETE')
@endif
Showing {{ $categories->firstItem() }} to {{ $categories->lastItem() }} of {{ $categories->total() }} categories @if(request()->has('filter') && request('filter') == 'archived') Archived View @endif
@else
No categories found

@if(request()->has('search') || request()->has('filter')) Try changing your search criteria or clear filters @else Get started by creating your first category @endif

Add New Category @if(request()->has('filter') && request('filter') == 'archived') View Active Categories @endif
@endif
@endsection @section('script') @endsection