Product Management

Manage floral designs, inventory items, pricing, and activation states.

Selected: 0
@if($errors->any()) @if(old('product_id')) @php $oldProduct = \App\Models\Product::with('images')->find(old('product_id')); @endphp @if($oldProduct) @php $oldProductPayload = [ 'id' => $oldProduct->id, 'name' => old('name', $oldProduct->name), 'price' => (float)old('price', $oldProduct->price ?? 0), 'category' => (string)old('category', $oldProduct->category_id), 'description' => old('description', $oldProduct->description ?? ''), 'images' => $oldProduct->images->map(fn($img) => [ 'id' => $img->id, 'path' => asset('storage/' . $img->path) ])->toArray() ]; @endphp
@endif @else
@endif @elseif(session('open_create_modal'))
@elseif(session('open_edit_modal_id')) @php $editProduct = \App\Models\Product::with('images')->find(session('open_edit_modal_id')); @endphp @if($editProduct) @php $editProductPayload = [ 'id' => $editProduct->id, 'name' => $editProduct->name, 'price' => (float)$editProduct->price, 'category' => (string)$editProduct->category_id, 'description' => $editProduct->description ?? '', 'images' => $editProduct->images->map(fn($img) => [ 'id' => $img->id, 'path' => asset('storage/' . $img->path) ])->toArray() ]; @endphp
@endif @endif @push('scripts') @endpush