@extends('layouts.admin') @section('title', 'Categories') @section('content') @php($canManage = auth()->user()?->hasPermission('categories', 'manage')) @php($parentCategories = \App\View\ServicesMegaMenu::parentGroupLabels()) @php($totalCategories = method_exists($categories, 'total') ? $categories->total() : $categories->count())

Service Categories

Create, classify, and manage service category groups

{{ $totalCategories }} Categories @foreach($parentCategories as $value => $label) {{ $label }}: {{ (int) ($parentCategoryCounts[$value] ?? 0) }} @endforeach
@if($canManage)
Add Category
Assign it to a parent group
@csrf
@error('parent_category')
{{ $message }}
@enderror
@error('slug')
{{ $message }}
@enderror Leave blank to auto-generate from the name.
@error('description')
{{ $message }}
@enderror
@endif

Category List

Inline edit names and parent category assignments

Category Slug Parent Category {{-- Services --}} Actions @forelse($categories as $category) @if($canManage)
@csrf @method('PUT')
@else {{ $category->name }} @endif {{ $category->slug ?: '—' }} @if($canManage) @endif @if($canManage) @else {{ $parentCategories[$category->parent_category] ?? '-' }} @endif {{-- {{ $category->services_count }} --}} @if($canManage)
@csrf @method('DELETE')
@else - @endif @empty No categories found. @endforelse
{{ $categories->links() }}
@endsection