@extends('layouts.app') @section('title', 'Manage Categories - Admin') @push('styles') @endpush @section('content') @php $isTreeView = request('view') === 'tree'; $queryParams = request()->except('page'); @endphp

Categories

{{ $totalCategories }} categories · {{ $totalProductTypes ?? 0 }} product types

{{-- Sidebar filters --}}
Filters
@foreach([ ['url' => route('admin.categories.index'), 'active' => !request()->hasAny(['status','featured','tier','gender','home','trashed','view']), 'icon' => 'bi-tags', 'label' => 'All', 'count' => $totalCategories], ['url' => route('admin.categories.index', ['view' => 'tree']), 'active' => $isTreeView, 'icon' => 'bi-diagram-2', 'label' => 'Tree View', 'count' => null], ['url' => route('admin.categories.index', ['tier' => 'main']), 'active' => request('tier') == 'main', 'icon' => 'bi-grid-1x2', 'label' => 'Main', 'count' => $mainCategories], ['url' => route('admin.categories.index', ['status' => 'active']), 'active' => request('status') == 'active', 'icon' => 'bi-check-circle text-success', 'label' => 'Active', 'count' => $activeCategories], ['url' => route('admin.categories.index', ['featured' => 'yes']), 'active' => request('featured') == 'yes', 'icon' => 'bi-star text-warning', 'label' => 'Featured', 'count' => $featuredCategories], ['url' => route('admin.categories.index', ['home' => 'yes']), 'active' => request('home') == 'yes', 'icon' => 'bi-house text-primary', 'label' => 'On Home', 'count' => null], ['url' => route('admin.categories.index', ['trashed' => 1]), 'active' => request('trashed'), 'icon' => 'bi-trash text-danger', 'label' => 'Trash', 'count' => null], ] as $filter) {{ $filter['label'] }} @if($filter['count'] !== null) {{ $filter['count'] }} @endif @endforeach
Add Category Export CSV
{{-- Main content --}}

Category Manager

Beauty store hierarchy · Categories stop at Shampoo/Cream level · Products use Product Types

@unless($isTreeView)
@csrf
0 selected
@csrf
@endunless @if($isTreeView && !empty($tree))
@include('admin.categories.partials.tree-node', ['nodes' => $tree, 'depth' => 0])
@elseif($isTreeView)
No categories in tree.
@else {{-- Desktop table --}}
@forelse($categories as $cat) @empty @endforelse
Category Level Types Status Actions
@include('partials.category-thumb', ['category' => $cat, 'class' => 'me-3', 'size' => 48])
{{ $cat->name }}
/{{ $cat->slug }} @if($cat->parent){{ $cat->parent->name }}@endif
{{ $cat->levelLabel() }} {{ $cat->product_types_count }} @if($cat->status) Active @else Hidden @endif
@csrf
@csrf @method('DELETE')
{{-- Mobile cards --}}
@foreach($categories as $cat)
@include('partials.category-thumb', ['category' => $cat, 'size' => 56, 'variant' => 'md'])
{{ $cat->name }} {{ $cat->levelLabel() }}
/{{ $cat->slug }} · {{ $cat->product_types_count }} types
@if($cat->status)Active @elseHidden@endif {{ $cat->products_count }} products
@csrf @method('DELETE')
@endforeach
No categories found
Create Category
@if($categories->hasPages())
{{ $categories->links('pagination::bootstrap-5') }}
@endif @endif
{{-- Right sidebar --}}
Summary
Categories{{ $totalCategories }}
Product Types{{ $totalProductTypes ?? 0 }}
Active{{ $activeCategories }}
Featured{{ $featuredCategories }}
Pro Structure

Main → Category → Sub → Product Type → Product → Variant

Example: Hair Care → Shampoo → Anti Hair Fall → Dove 340ml

API
GET /api/categories/tree GET /api/categories/featured GET /api/categories/{id}/breadcrumbs
@endsection @push('scripts') @endpush