The Bootstrap CSS framework has become very popular recently. This recipe will show how we can use the framework with Laravel.
For this recipe, we need a standard Laravel installation. We'll also need to have the assets
package installed, as demonstrated in the Adding assets recipe. Optionally, we could download the Bootstrap files and save them locally.
To complete this recipe, follow these steps:
In the
routes.php
file, create a new route as follows:Route::any('boot', function() { Asset::add('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'); Asset::add('bootstrap-js', 'http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js', 'jquery'); Asset::add('bootstrap-css', 'http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css'); $superheroes = array('Batman', 'Superman', 'Wolverine','Deadpool', 'Iron Man'); return View::make('boot')->with('superheroes...