Ok, then you need to pass this category variable to all of the pages, though we’ve used some global variable to access them from all of the view pages.
This is the code $top_categories = Category::whereCategoryId(0)->orderBy('category_name', 'asc')->get();
look at controller. you need make it for global accessible.
If you are a developer, then you will understand. I’m giving you a piece of code.
At file root/app/Providers/AppServiceProvider.php
Delete below code from line 53 to 63
view()->composer('*', function ($view) {
$header_menu_pages = Post::whereStatus('1')->where('show_in_header_menu', '1')->get();
$show_in_footer_menu = Post::whereStatus('1')->where('show_in_footer_menu', '1')->get();
$enable_monetize = get_option('enable_monetize');
$loggedUser = null;
if (Auth::check()) {
$loggedUser = Auth::user();
}
$view->with(['lUser' => $loggedUser, 'enable_monetize' => $enable_monetize, 'header_menu_pages' => $header_menu_pages, 'show_in_footer_menu' => $show_in_footer_menu]);
});
Add below code right that place
view()->composer('*', function ($view) {
$header_menu_pages = Post::whereStatus('1')->where('show_in_header_menu', '1')->get();
$show_in_footer_menu = Post::whereStatus('1')->where('show_in_footer_menu', '1')->get();
$top_categories = Category::whereCategoryId(0)->orderBy('category_name', 'asc')->get();
$enable_monetize = get_option('enable_monetize');
$loggedUser = null;
if (Auth::check()) {
$loggedUser = Auth::user();
}
$view->with(['lUser' => $loggedUser, 'enable_monetize' => $enable_monetize, 'top_categories' => $top_categories, 'header_menu_pages' => $header_menu_pages, 'show_in_footer_menu' => $show_in_footer_menu]);
});
That’s it, this should now work
Best regards