Posts tagged with: featured

Laravel 4 – composer and packagist

Just released: the new Laravel version 4. The most important change is that laravel now embraces composer, the php package installer. This is good news if you want to use one of the many packagist packages available through composer, but this makes life a bit more complicatied as well. The old bundle system was a bit restricted but had one large advantage: ease of use.

What you need to keep in mind is that not all packages are structured in the way that laravel understands. For instance, you can install the original twitter bootstrap package but that leaves you with a directory structure like

But for laravel you need all img/js/css in a public directory like:

So how do we cope with this? Of course you can use the special laravel bootstrapper package, but that comes with pre-compiled bootstrap.
What we want is to configure bootstrap and then use Basset (the laravel asset compiler) to lesscompile/minimize all bootstrap resources and put the result in our laravel /public dir. But we don’t want to change anything to the bootstrap package because we want to be able to update to newer versions in the future.

Please leave a comment if you’ve found a beautiful solution to this.