Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Rainieren's avatar

Laravel bootstrap 4 implementation

Hello, I was testing something with a new laravel project and I'm trying to make bootstrap 4 work. I added every link to the files in my app.blade.php like this


<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<link rel="stylesheet" href="{{ asset('https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css') }}" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.min.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/font-awesome.css') }}">
<link rel="stylesheet" type="text/css" href="{{ asset('css/app.css') }}">

And like this

<script src="{{ asset('js/app.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/jquery-3.2.1.min.js') }}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script type="text/javascript" src="{{ asset('js/bootstrap.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/bootstrap.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('js/app.js') }}"></script>

but it still uses the regular bootstrap 3 that laravel uses as standard. I don't get why it isnt working. Tips are welcome

0 likes
3 replies
topvillas's avatar

Just pull in bootstrap. You don't need the asset helper to grab it from a CDN.

tisuchi's avatar
tisuchi
Best Answer
Level 70

It seems that you are using laravel mix. If so, until now laravel use "bootstrap-sass": "^3.3.7", version. I think you need to change it here and update your laravel mix.

Ref: https://laravel.com/docs/5.5/mix

6 likes
Rainieren's avatar

@tisuchi I don't quite understand what the article says. I don't know what to do. Can you maybe give me some instructions? I think you're right about the laravel mix thing, I am running laravel 5.5 I believe. In my previous project, it worked perfectly fine like this.

Please or to participate in this conversation.