@Snapey I did this but it seems that nothing has changed?
Is it possible that this is the problem?
public function boot()
{
Event::listen(BuildingMenu::class, function (BuildingMenu $event) {
//ADMIN
$event->menu->addBefore('products',[
'text' => 'Dashboard',
'url' => route('admin.dashboard', app()->getLocale()),
'icon' => 'fas fa-fw fa-columns',
'can' => 'admin_aviable',
]);
//products
$event->menu->addIn('products',[
'text' => 'All Products',
'url' => route('admin.products', app()->getLocale()),
]);
$event->menu->addIn('products',[
'text' => 'Pending Products',
'url' => route('admin.pending.products', app()->getLocale()),
]);
$event->menu->addIn('products',[
'text' => 'Add Products',
'url' => route('add.product.view', app()->getLocale()),
]);
//customers
$event->menu->addAfter('products',[
'key' => 'customer',
'text' => 'Customers',
'url' => route('admin.customers', app()->getLocale()),
'icon' => 'fas fa-fw fa-users',
'can' => 'admin_aviable',
]);
//orders
$event->menu->addAfter('customer',[
'text' => 'Orders',
'url' => route('orders', app()->getLocale()),
'icon' => 'fas fa-fw fa-envelope',
'can' => 'admin_aviable',
]);
//categories
$event->menu->addIn('categories',[
'text' => 'All Categories',
'url' => route('admin.categories', app()->getLocale()),
],
[
'text' => 'Add Category',
'url' => route('admin.add.category', app()->getLocale()),
]);
//sections manager
$event->menu->addAfter('categories', [
'key' => 'manager',
'header' => 'Manager',
]);
$event->menu->addAfter('manager',[
'text' => 'First Section',
'url' => route('admin.first.section.manager.view', app()->getLocale()),
'icon' => 'fas fa-fw fa fa-puzzle-piece',
'can' => 'admin_aviable'
],
[
'text' => 'Second Section',
'url' => route('admin.second.section.manager.view', app()->getLocale()),
'icon' => 'fas fa-fw fa fa-puzzle-piece',
'can' => 'admin_aviable'
],
[
'text' => 'Third Section',
'url' => route('admin.third.section.manager.view', app()->getLocale()),
'icon' => 'fas fa-fw fa fa-puzzle-piece',
'can' => 'admin_aviable'
],
[
'text' => 'Fourth Section',
'url' => route('admin.fourth.section.manager.view', app()->getLocale()),
'icon' => 'fas fa-fw fa fa-puzzle-piece',
'can' => 'admin_aviable'
]);
});
}
because whenever I go inside the admin the model calls to the Role model are absurde!