@extends('layouts.admin') @section('title', $category->exists ? $category->title : 'Add category') @section('content') @php $imageSelected = old('image_media_asset_id') ? \App\Models\MediaAsset::query()->with('variants')->find(old('image_media_asset_id')) : ($imageAsset ?? null); @endphp
@csrf @if($category->exists) @method('PUT') @endif Back @if($errors->any())
{{ $errors->first() }}
@endif
{{ $category->exists ? $category->products->count() : 0 }} currently assigned
@forelse($products as $product) @empty

No products in catalogue yet.

@endforelse
@if($category->exists)

Saving syncs membership. Unchecking removes a product from this category only.

@endif
{{ old('seo_title', $category->seo_title ?: $category->title ?: 'Category title') }}
{{ url('/collections/'.(old('handle', $category->handle) ?: 'category-handle')) }}
{{ old('seo_description', $category->seo_description ?: \Illuminate\Support\Str::limit(strip_tags((string) $category->description), 150)) }}
@if($category->exists) @forelse($category->children as $child) {{ $child->title }} @empty

No child categories.

@endforelse + Add child
@endif
@if($category->exists) @endif @endsection