wikigods/laravel-sidebar builds, authorizes, caches and renders grouped navigation menus for Laravel applications.
You describe the menu once, in a plain PHP class:
use Wikigods\Sidebar\Badge;
use Wikigods\Sidebar\Group;
use Wikigods\Sidebar\Item;
$this->menu->group('Administration', function (Group $group) {
$group->item('Users', function (Item $item) {
$item->route('admin.users.index');
$item->icon('fa fa-users');
$item->badge(fn (Badge $badge) => $badge->setValue(User::count()));
$item->authorizePermission('users.view');
});
});
The package takes care of the rest:
php artisan sidebar:install, that generates the sidebar class and the configuration.This package continues Laravel Sidebar by Maatwebsite.nl under the Wikigods\Sidebar namespace. Applications using maatwebsite/laravel-sidebar can follow the upgrade guide.