I needed to rebuild a simple game timer app and figured it would be a great way to get my feet wet with Laravel. I’ve heard great things about it and wanted to give it a try. I also wanted to upgrade the application to use Zurb Foundation 5, since I already used 4 with the application and wanted to use the latest and greatest. Unfortunately, there aren’t any composer packages or ruby gems or other handy installers to get Zurb into my Laravel project. It turns out it isn’t as hard as you might think.
To add Zurb Foundation 5 to your Laravel 4 project, you simply need to do the following:
- Follow the Laravel Quickstart to start a fresh application if you don’t have one already.
- Download Zurb Foundation 5 from their site. Note: Don’t install the Sass version. This may be a deal breaker for you, but not for me.
- Copy the css resources into the public/css folder in your Laravel project.
- Edit your app/views/layout.blade.php file so that it looks something like this:[gist ae09983bf26427908e9e]
That’s all there is to it! You can see where there are yield statements for title, content, and custom script imports, as well as a basic top bar with navigation in place. You can customize this to your heart’s content.
Enjoy Laravel 4 and Zurb Foundation 5 quick and easy!