@php if (!isset($product)) { $banner = null; $banner_single = null; if (isset($componentable)) { if (array_has($componentable, 'banner')) { $banner = $componentable->banner; } else { $banner = false; } } elseif (isset($post) && empty($use_tax)) { if (array_has($post, 'banner')) { $banner = $post->banner; } else { $banner = false; } } elseif (isset($taxonomy) || isset($tax)) { $taxonomy = $taxonomy ?? $tax; $banner = $taxonomy->banner; } if (!isset($banner->type) || $banner->type == 'default') { $site = \App\Site::first(); if (!empty($site->default_image_id)) { $banner = (object) [ 'type' => 'image', 'images' => [(object) ['image' => $site->default_image]] ]; // Set banner for Product so banner partial can interpret it $banner_single = 1; } } } @endphp