@php $title = $data->title; $args = []; $routeParams = []; $url = $data->url; $category_mode = false; $categories = []; $args['@limit'] = $data->limit && $data->limit > 0 ? $data->limit : 4; $args['@sorttype'] = $data->sorttype(1); $routeParams['sorttype'] = $data->sorttype(1); if ($data->category_id && ($category = $helper->getProductCategory(['id' => $data->category_id]))) { $args['@anyCategories'] = [$data->category_id]; $routeParams['category_id'] = $data->category_id; if (!$url) { $url = route('web.products', $routeParams); } if (!$title) { $title = $category->name; } } if ($args) { $args = array_merge($args, [ '@withPromoAvailable' => true, '@withLabels' => function($query){$query->with('localeContent');}, '@withOption' => true, '@withGallery' => true, '@withCategory' => [ '@withLocaleContent' => true, ], ]); } @endphp