Laravel can be installed with the Laravel installer or composer. Both installers will place the application into a folder which is named after the application. Sometimes we want to affect that behaviour.
When developing in Windows I’m using Wampserver. When switching to OS X I started searching for an alternative and found some possible solutions. After testing some, I found AMPPS to be the best alternative because of the ease of adding domains. For optimal usage and developing with Laravel, it requires some extra configuration.
One of the first thing to install for PHP development is Composer. The installation is pretty much straight forward, but it’s not available globally after installation.
- Download composer:
url -sS https://getcomposer.org/installer | php
- Move the the bin folder:
mv composer.phar /usr/local/bin/composer.phar
.bash_profilewith the editor of your choice (nano, vim, etc.)
alias composer="php /usr/local/bin/composer.phar"
- Close terminal and open again
After this, Composer is available globally.
There are many packages available for asset management in Laravel. Although some are pretty good, I think asset management packages aren’t really necessary in Laravel thanks to the Blade template engine. So with those words, let’s put my money where my mouth is and show you the way I’m managing my assets in Laravel.
In Laravel 5 the HTML and Form builder got removed because it shouldn’t be in the core of the framework. I can see their point there, but if you are upgrading your project it would be a lot of work to change all those calls. So I want to get the HTML and form builder back. The Laravel Collective maintains (and improve) packages which are removed from Laravel. The HTML and Form package from them is preferred over the
illuminate/html package, because it’s better maintained. So let’s add their package to our Laravel installation.
Currently I’m converting my Laravel 4 application to Laravel 5. When finding tricks or goofs I will post it to this blog.
One of the first thing I’m doing after installing Laravel is changing the public directory. In Laravel 4 it was pretty straight forward, just edit the
bootstrap/paths.php. Unfortunately in Laravel 5 it’s a bit more tricky, but not that hard either.