Closed DmitrySkibitsky closed 5 years ago
$query = Category::query(); $query->with(['children' => function ($query) { $query->join('category_item_translations', function ($join) { $join->on('category_items.id', '=', 'category_item_translations.category_item_id'); $join->where('category_item_translations.locale', app()->getLocale()); }); $query->select([ 'category_items.id', 'category_items.category_id', 'category_items.slug', 'category_item_translations.name' ]); $query->orderBy('category_items.sorting_order', 'asc'); }]); if (count($params) > 0) { if (in_array('show_on_footer', $params)) { $query->where('show_on_footer', true); } } $query->join('category_translations', function ($join) { $join->on('categories.id', '=', 'category_translations.category_id'); $join->where('category_translations.locale', app()->getLocale()); }); return $query->select([ 'categories.id', 'category_translations.name', ])->orderBy('sorting_order', 'asc')->get();
@foreach($footer_categories as $category) {{dd($category)}} @endforeach
The $width property is missing from the model.
Q: where does this array with all localization data come from?
The $width property is missing from the model.
Q: where does this array with all localization data come from?