Integrate Bootstrap in Laravel 5.4


I'm starting with Laravel and I'm having trouble linking routes with Bootsrap

<!DOCTYPE html>
<html lang="en">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    {{ HTML::style('assets/css/bootstrap.min.css', array('media' => 'screen')) }}
    <!-- <link href="{{ asset('assets/css/bootstrap.min.css')}}" rel="stylesheet"> -->

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src=""></script>
    <script src=""></script>
    <div class="container">
        <button type="button" class="btn btn-primary">Primary</button>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="">
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src={{ url('/assets/js/bootstrap.min.js')}}></script>

And I can not get it linked, with the link it does not send me an error but it does not load the styles and with HTML::style send me:


Class 'HTML' not found

This is the structure of my project.

asked by M. Gress 30.03.2017 в 00:04

1 answer


To add the link to a resource within Public we usually use:

<script src="{{asset('components/bootstrap/js/bootstrap.min.js')}}" type="text/javascript"></script>

where the directory is:


Application / public / components / bootstrap / js / bootstrap.min.js

You can see the documentation on asset


I see that in the image the bootstrap files (the web framework) are in the "bootstrap" folder of Laravel. The Bootstrap folder in the main Laravel directory is not for maintaining scripts or style sheets related to the client. This is a translation of the use of this directory:


The bootstrap Directory


The bootstrap directory contains files that initialize the framework and configure autoloading. This directory also contains the cache generated by the framework for performance optimization.

In Bootstrap directory, Laravel documentation

answered by 03.04.2017 / 18:48