wikigods / laravel-sidebar
A sidebar builder for Laravel: menus, groups, items, badges, permissions and caching.
Requires
- php: ^8.1
- illuminate/cache: ^10.0|^11.0|^12.0|^13.0
- illuminate/console: ^10.0|^11.0|^12.0|^13.0
- illuminate/container: ^10.0|^11.0|^12.0|^13.0
- illuminate/contracts: ^10.0|^11.0|^12.0|^13.0
- illuminate/routing: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- illuminate/view: ^10.0|^11.0|^12.0|^13.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- mockery/mockery: ^1.6
- orchestra/testbench: ^8.0|^9.0|^10.0|^11.0
- phpunit/phpunit: ^10.5|^11.5|^12.0
Suggests
- cartalyst/sentinel: Required for the `sentinel` permission driver.
- spatie/laravel-permission: Default permission driver (any Gate-based `can()` check also works).
Provides
None
Conflicts
None
Replaces
None
README
| Laravel | PHP | laravel-sidebar |
|---|---|---|
| 10.x | 8.1+ | ^1.0 |
| 11.x | 8.2+ | ^1.0 |
| 12.x | 8.2+ | ^1.0 |
| 13.x | 8.3+ | ^1.0 |
wikigods/laravel-sidebar builds, authorizes, caches and renders grouped navigation menus for Laravel applications. It ships with AdminLTE 2, AdminLTE 3 and AdminLV (Bootstrap 5) templates, permission drivers (Laravel Gate / Spatie, Sentinel), per-user caching and an interactive installer.
$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'); }); });
Install
Install the package with Composer:
composer require wikigods/laravel-sidebar
The service provider is registered automatically. Run the installer to generate a sidebar class and config/sidebar.php:
php artisan sidebar:install
Print the sidebar in your layout (the default target view is admin.partials._sidebar):
{!! $sidebar !!}
And add the sidebar middleware to the routes that render it:
Route::middleware(['auth', 'sidebar'])->group(function () { // ... });
Documentation
You'll find installation instructions and full documentation on https://wikigods.github.io/laravel-sidebar/.
Coming from maatwebsite/laravel-sidebar? Read the upgrade guide.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Testing
composer test
Contributing
Contributions are welcome. Please add or update tests for behaviour changes and make sure composer test passes before opening a pull request.
Security
If you discover any security related issues, please use the GitHub security advisories instead of the issue tracker.
Credits
- wikigods
- Maatwebsite.nl, author of the original package
- All contributors of the original project
About
wikigods/laravel-sidebar continues Laravel Sidebar by Maatwebsite.nl under a new namespace (Wikigods\Sidebar), with support for Laravel 10 to 13, an interactive installer and permission drivers. Thank you to its original authors and contributors.
License
The MIT License (MIT). Please see License File for more information.