Search code examples
laravelbootstrap-4hamburger-menu

Bootstrap 4 toggle button (hamburger) is not working in fresh Laravel 7 project


I installed a new laravel 7 project with auth and created a simple template with bootstrap studio. After integrating the template into the laravel project everything runs perfectly, except for the toggle menu (hamburger), which does not expand.

The strange thing is, if I integrate the bootstrap and jquery cdn again, although these are included in the app.js by default, the toggle menu works:

<script src="{{ asset('js/app.js') }}"></script>
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

Can it be that a reduced version of bootstrap and jquery is included in laravel or what could this be?


Solution

  • I found the problem on github. It was reported there and it appears to be due to jquery and can be resolved by downgrading jquery from version 3.5.0 to 3.4.1.

    https://github.com/laravel/ui/issues/91