Menu not adding in Admin
-
Hi,
When i try to add menu through menu.php file under config directory. Menu does not come in sidebar in admin.
below is my code for adding menu "Commission Rule"[
'key' => 'commission-rule',
'name' => 'admin::app.layouts.commission-rule',
'route' => 'admin.commission-rule',
'sort' => 11,
'icon-class' => ''
],Can you please guide me about it
-
Whenever you do some changes in the menu, just run this command,
php artisan optimize
orphp artisan config:cache
-
But in which file is the route command to be placed?
I checked here: https://devdocs.bagisto.com/1.x/packages/add-menu-in-admin.html
but I don't know which file to use. -
Route command?
I am not getting what you are trying to say.
-
It's this one:
For the route, just add the named route which specified above i.e. helloworld.admin.index,
Route::view('/admin/hello-world', 'helloworld::admin.index')->name('helloworld.admin.index');
But I'm missing the information in which file to put it.
I tried routes/web.php but that results in missing route error.
Somwhere down this route I had an object error saying that a 'name' is not accessible. Now everytime I try to admin login I get an "419 expired" error. -
After updating any route just run
php artisan optimize
command. Because routes are cached.