@if (Auth::check())
@endif
{{ $slot }}
@php
// $globalProducts comes from AppServiceProvider View::share
$productCollection = $globalProducts ?? collect();
$foodData = $productCollection
->map(function ($product) {
return [
'id' => $product->id,
'name' => $product->name,
'category' => $product->category ? $product->category->name : 'other',
'price' => $product->price,
'discountPrice' => $product->delete_price,
'image' => $product->image,
'description' => $product->name . ' - Delicious and fresh!',
'rating' => 4.5,
];
})
->toArray();
$categories = $productCollection->pluck('category')->unique('id')->filter()->values();
@endphp