1. Go to this page and download the library: Download hieu-le/laravel-menu library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hieu-le / laravel-menu example snippets
$menu = app('menu.manager')->menu($menuName); // the default value of $menuName is "default"
# with the registered alias, you can also do this
$menu = Menu::menu($menuName);
$menu->setLabel('Sidebar navigation');
// routes.php
Route::get('/posts/{post_id}/comments/{comment_id}', ['as' => 'posts.comments.detail'];
// your menu definitions
$menu->addLink($text, ['route' => ['posts.comments.detail', 'post_id' => 1, 'comment_id' => 99]]);
// the output link is: /posts/1/comments/99
// routes.php
Route::get('/posts/{post_id}/comments/{comment_id}', ['use' => 'PostController@viewComment'];
// your menu definitions
$menu->addLink($text, ['action' => ['App\Http\Controllers\PostController@viewComment', 1, 99]]);
// the output link is: /posts/1/comments/99