Updated 5 August 2022
Here we are going to discuss how to add a menu in the admin panel in Bagisto. Just with a few lines of codes, we can add the menu it`s super easy
Inside the given path folder of bagisto, create a file of the name menu.php.
Path – packages/ACME/HelloWorld/Config
create an array of key-value pairs contains with four keys key, name, route, sort, icon-class
key – Unique key for menu icon.
name – Name of menu icon.
route – Route name for your menu icon.
sort – Sort the number on which your menu icon should display.
icon-class – Class for menu icon.
1 2 3 4 5 6 7 8 9 10 11 |
<?php return [ [ 'key' => 'custom-menu', 'name' => 'Hello', 'route' => 'admin.menu.index', 'sort' => 1, 'icon-class' => 'menu-icon', ] ]; |
Then register it to the Service Provider file using the mergeConfigFrom(path of the menu-file, menu.admin ) in PackagenameServiceProvider.php
1 2 3 4 5 6 7 8 9 10 11 12 |
/** * Register services. * * @return void */ public function register() { $this->mergeConfigFrom( dirname(__DIR__) . '/Config/menu.php', 'menu.admin' ); } |
Then Run a command
1 |
php artisan optimize |
That’s all for adding the menu in Bagisto. Stay tuned for more updates on these types of topics. If you have any issues feel free to raise a ticket at https://bagisto.uvdesk.com/en/
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.