@extends('layouts.app') @section('title', 'Categories') @section('page-title', '๐Ÿท๏ธ Category Management') @section('page-subtitle', 'Organise clients, schedules & content by category') @section('content')
@if(session('success'))
{{ session('success') }}
@endif {{-- Add form --}}
@csrf
{{-- List --}}
๐Ÿ—‚๏ธ

All Categories

{{ $categories->count() }} total
@php $roots = $categories->whereNull('parent_id'); @endphp @forelse($roots as $root)
{{-- Root row --}}
{{ $root->icon ?: '๐Ÿท๏ธ' }} @if($root->color) @endif
{{ $root->name }}
{{ $root->children->count() }} sub ยท {{ $root->clients_count }} client(s)
@unless($root->is_system)
@csrf @method('DELETE')
@endunless
{{-- Edit form --}} {{-- Children --}} @foreach($root->children as $child)
{{ $child->icon ?: 'โ†ณ' }} @if($child->color) @endif
โ†ณ {{ $child->name }}
{{ $child->clients_count }} client(s)
@unless($child->is_system)
@csrf @method('DELETE')
@endunless
@endforeach
@empty
๐Ÿท๏ธ

No categories yet. Add your first one above.

@endforelse
@endsection