Update (views): Fix bug, add world logic
This commit is contained in:
@@ -49,6 +49,7 @@ class Category extends Model
|
||||
'name',
|
||||
'short_name',
|
||||
'slug',
|
||||
'description',
|
||||
'enabled',
|
||||
'is_top',
|
||||
'_lft',
|
||||
|
||||
@@ -37,6 +37,8 @@ class CountryLocale extends Model
|
||||
'name',
|
||||
'slug',
|
||||
'i18n',
|
||||
'lang',
|
||||
'country_iso',
|
||||
'enabled',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public function compose(View $view)
|
||||
|
||||
if (is_null($current_country_locale))
|
||||
{
|
||||
$current_country_locale = CountryLocale::where('slug', config('platform.general.fallback_country_slug'));
|
||||
$current_country_locale = CountryLocale::where('slug', config('platform.general.fallback_country_slug'))->first();
|
||||
}
|
||||
|
||||
$categories = Category::where('country_locale_id', $current_country_locale->id)->get();
|
||||
|
||||
@@ -20,10 +20,9 @@ public function compose(View $view)
|
||||
}
|
||||
else
|
||||
{
|
||||
$current_country_locale = CountryLocale::where('slug', config('platform.general.fallback_country_slug'));
|
||||
$current_country_locale = CountryLocale::where('slug', config('platform.general.fallback_country_slug'))->first();
|
||||
}
|
||||
|
||||
|
||||
$view->with('country_locales', $country_locales)
|
||||
->with('current_country_locale', $current_country_locale);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user