Loading MDBootstrap (jquery-version) in Laravel 6

Topic: Loading MDBootstrap (jquery-version) in Laravel 6

Tenarius asked 2 years ago

I use MDBootstrap in the jquery version for my Laravel 6 project. I downloaded it via NPM and am now trying to integrate it into my project.

The CSS data can be loaded easily by integrating it into the app.scss with @import '~mdbootstrap-pro/css/mdb.min.css';.

Loading the JS data does not work, if I write in my app.js, require ('./../../node_modules/mdbootstrap-pro/js/mdb.min.js'); after running npm run dev.

There is no browser error. The MDB-JS code exists in my app.js, I checked it. There is no change externally, as if the code was not... there. Mystically.

Here's the crazy one:

If I insert the same file into my HTML document via <script src =" ./../node_modules/mdbootstrap-pro/js/mdb.min.js "> </script>, everything works perfectly.

Does anyone have any idea why this is and what I can do there?

Grzegorz Bujański staff commented 2 years ago

Hi. Have you tried using configuration from this topic: https://mdbootstrap.com/support/jquery/issue-with-4-9-0-webpack-typescript/ ? At the moment we don't have a solution for integration Laravel and MDB via NPM. We recommend downloading the zip and adding it as a assets to the Laravel project and using configuration from topic to which I gave the link above.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.16.0
  • Device: PC
  • Browser: Firefox
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No