NOTE: This project is archived and not updated anymore. Please simply use the latest version of Laravel, which contains an awesome list of frontend scaffolding.
The Laravel Boilerplate repository provides a simple Laravel 4 PHP framework setup including Bower and Grunt.
- Composer, http://getcomposer.org
- Bower, http://bower.io
- Grunt, http://gruntjs.org
- Download or
git clone
this repository - Run
composer install
php artisan key:generate
bower install
npm install
For further information on Laravel setup ( database configuration, ... ) please take a look at http://laravel.com.
You can start developing immediately after installing the boilerplate.
- Run
grunt develop
on your command line - Open http://your-url-to-laravel.local
- Modify some CSS or JS files located within your app/assets/ directory and watch the frontend change automatically due to livereload
Described in a nutshell, the approach of this laravel development setup is, that all resources ( *.css, *.js, *.less, ... ) from third party libraries as well as your own resources are stored within the restricted non-public app/ directory.
All files available or required within the web application are compiled, built or just copied to the public directory using tools such as Grunt.
This allows you as a developer, working on your source files without the need to care about modifying JavaScript or CSS file inclusions, when deploying your application.
Let's assume you as a developer would like to add an additional library to work with. In order to show how easy you can do so, here's an example of how to integrate UnderscoreJS within your laravel project.
- Install the package and add it to the bower.json file:
bower install --save underscore
-
Add the underscore.js source file to the target task within the Gruntfile.js configuration file:
// JS file concatenation concat: { options: { separator: ';' }, javascript: { src: [ './app/assets/components/bower/underscore/underscore.js', './app/assets/components/bower/jquery/jquery.min.js', './app/assets/components/bower/bootstrap/dist/js/bootstrap.min.js', './app/assets/js/frontend.js' ], dest: './public/assets/js/frontend.js' }, },
-
Run the
grunt develop
task to start developing with the new package installed.
Special thanks to Elena Kolevska, who inspired me with her Laravel Grunt implementation and her excellent blog article.
And of course, I would like to thank all Laravel Framework developers, that made up this great framework.