Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Integrate MDBootstrap into Laravel

Hennikoe free asked 5 years ago


Hello, I've been reading some videos and blog entries about the implementation of MDBootstrap in Laravel 5.7.

I also looked at the documentation of Laravel but I didn't find it very explanatory for newbies.

So please, could you write me and others who have the question a text and publish sample code on how the best way to import the files from MDBootstrap jQuery Pro into Laravel 5.7 is?


softcon premium answered 3 years ago


There is an easy way to import MDBootstrap in to Laravel, without using additional vendors or and CLI whatsoever.

Simply copy the mdb.min.js and mdb.min.js.map to your public/js folder.Next copy the mdb css files (there should be around 8 of them) to your public/css folder.

Now in the area of your project (I use a head blade include file for this), add the following CSS links:

   <!-- import Font Awesome -->
   <link
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"
rel="stylesheet">

   <!-- import Material Icons from Google Fonts -->
   <link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons">

   <!-- import MDB Pro -->
   <link rel="stylesheet" href="/css/mdb.min.css" />

...then just before your closing BODY tag (I use a "foot" blade include), add the following code...

 <!-- import the MDB javascript file https://mdbootstrap.com/ -->    
<script
    type="text/javascript"
    src="{{ asset('js/mdb.min.js') }}">
</script>

...just remember to update the files when new releases occur.


Marcin Luczak staff commented 3 years ago

Hi @softcon,

Thank you for this great explanation :)

Regards, Marcin


Ben Amato free commented 3 years ago

ah very simple and helpfull, thanks



Currently, we don't support Laravel. It's a common question so I hope, one day we'll create a tutorial that would help you to integrate MDB with Laravel


Hennikoe free commented 5 years ago

But I bought MDBootstrap ONLY because I wanted to use it with Laravel. Isn't there a way to include MDBootstrap in laravel?


Bartłomiej Malanowski staff commented 5 years ago

Is there a way, but we've never tried to do that, so we never wrote a tutorial that would help you to do that. However, a lot of customers asks for this so I think I have no choice and I have to write a guide. Could you please tell us what have you tried so far? What exactly are you trying to achieve? Do you just want to import CSS/JS files or use Laravel Mix?


Hennikoe free commented 5 years ago

I just want to import css and js files into laravel 5.7 so I can use the complete MDBootstrap framework to design my website and admin panel properly. I tried in laravel to put the files in the public folder and then via. {{asset:. path }} to grab it.


Bartłomiej Malanowski staff commented 5 years ago

Please check this guide: https://www.cloudways.com/blog/laravel-bootstrap-template-integration/


arumcomputer free commented 5 years ago

Did you have the time during the last 10 month to just write that guide? I am not getting MBP to work properly with Laravel6. Seems to be an issue with JavaScript.



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.6.1
  • Device: MacBook
  • Browser: Safari
  • OS: Mac
  • Provided sample code: No
  • Provided link: No