Quantcast
Channel: Kernel panic » php
Viewing all articles
Browse latest Browse all 3

Laravel 4 – composer and packagist

$
0
0

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

/vendor
   /twitter
      /bootstrap
         /img
            glyphicons-halflings.png
         /js
            bootstrap-button.js
            ...


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

/vendor
   /twitter
      /bootstrap
         /public
            /img
               glyphicons-halflings.png
            /js
               bootstrap-button.js
               ...

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.

 

 


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images