@extends('layouts.admin') @section('title', $collection->exists ? $collection->title : 'Add collection') @section('content') @php $imageSelected = old('image_media_asset_id') ? \App\Models\MediaAsset::query()->with('variants')->find(old('image_media_asset_id')) : ($imageAsset ?? null); $type = old('type', $collection->type ?? 'manual'); @endphp
@csrf @if($collection->exists) @method('PUT') @endif @if($collection->exists && $collection->published) View storefront @endif Back @if($errors->any())
{{ $errors->first() }}
@endif
/collections/
{{ $collection->exists ? $collection->products->count() : 0 }} selected
@forelse($allProducts ?? [] as $p) @empty

No products in catalogue yet.

@endforelse

Preview match: {{ number_format($previewCount ?? 0) }} products

@if($collection->exists) @endif
    @forelse($collection->rules ?? [] as $rule)
  • {{ $rule->boolean }} {{ $rule->column }} {{ str_replace('_', ' ', $rule->relation) }} {{ $rule->condition }}
    @if($collection->exists) @endif
  • @empty
  • No rules yet — add a condition below after creating the collection.
  • @endforelse
@if(! $collection->exists)

Create the collection first, then add smart conditions on this screen.

@endif
{{ old('seo_title', $collection->seo_title ?: $collection->title ?: 'Collection title') }}
{{ url('/collections/'.(old('handle', $collection->handle) ?: 'handle')) }}
{{ old('seo_description', $collection->seo_description ?: \Illuminate\Support\Str::limit(strip_tags((string) $collection->description), 150)) }}
@if($collection->exists && $collection->rules_synced_at)

Last smart sync {{ $collection->rules_synced_at->diffForHumans() }}

@endif
@if($collection->exists) @csrf @endif
@if($collection->exists) @foreach($collection->rules as $rule) @endforeach @if($collection->type === 'smart' || $type === 'smart')
@csrf
@endif @endif @endsection