diff --git a/README.md b/README.md index a650c1e..5055f69 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![License](https://poser.pugx.org/lavary/laravel-menu/license.svg)](https://packagist.org/packages/lavary/laravel-menu) -A quick and easy way to create menus in [Laravel 6](http://laravel.com/) +A quick and easy way to create menus in [Laravel 6, 7 and 8](http://laravel.com/) __For Laravel 4.x, check [version 1.5.0](https://github.com/lavary/laravel-menu/tree/v1.5.0)__ @@ -1359,6 +1359,8 @@ This is how your Bootstrap code is going to look like: ``` +In case you are using bootstrap 5 (currently in beta) you need to set the `data-toggle-attribute` option from `data-toggle` to `data-bs-toggle` in your `config/laravel-menu/settings.php`. + #### Adding class attributes to child items Like adding a class to the menu `ul` and `ol`, classes can be added the submenu too. The three parameters to `asUl` are arrays as follows: diff --git a/src/Lavary/Menu/ServiceProvider.php b/src/Lavary/Menu/ServiceProvider.php index 1cc7826..f73fa2e 100644 --- a/src/Lavary/Menu/ServiceProvider.php +++ b/src/Lavary/Menu/ServiceProvider.php @@ -80,6 +80,10 @@ protected function bladeDirectives() Blade::directive('lm_endattrs', function ($expression) { return ''; }); + + Blade::directive('data_toggle_attribute', function ($expression) { + return config('laravel-menu.settings.default.data_toggle_attribute'); + }); } /** diff --git a/src/Lavary/Menu/resources/views/bootstrap-navbar-items.blade.php b/src/Lavary/Menu/resources/views/bootstrap-navbar-items.blade.php index 47909dd..7623417 100644 --- a/src/Lavary/Menu/resources/views/bootstrap-navbar-items.blade.php +++ b/src/Lavary/Menu/resources/views/bootstrap-navbar-items.blade.php @@ -1,6 +1,6 @@ @foreach($items as $item)