2017 © Pedro Peláez
 

library laravel-assetic

image

barryvdh/laravel-assetic

  • Wednesday, September 17, 2014
  • by Barryvdh
  • Repository
  • 4 Watchers
  • 37 Stars
  • 1,714 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 3 Open issues
  • 2 Versions
  • 5 % Grown

The README.md

Assetic for Laravel

A ServiceProvider based on https://github.com/mheap/Silex-Assetic, (*1)

Install via composer, add the ServiceProvider and configure assets/filters in the config., (*2)

Add this package to composer.json, (*3)

"require": {
    ..
    "barryvdh/laravel-assetic": "0.1.x"
}

And run composer update. If you get the error, barryvdh/laravel-assetic dev-master requires kriswallsmith/assetic ~1.2 -> no matching package found, you might need to add or change your composer.json settings to the following:, (*4)

{

    ...
    "minimum-stability": "dev",
    "prefer-stable": true

}

Then add the ServiceProvider to the providers array in app/config/app.php, (*5)

'providers' => array(
    ..
    'Barryvdh\Assetic\AsseticServiceProvider',
)

Finally publish the config file (php artisan config:publish barryvdh/laravel-assetic) and add your filters to the config., (*6)

// app/config/packages/barryvdh/laravel-assetic/config.php
'filter_manager' => function(FilterManager $fm){
     $fm->set('less', new \Assetic\Filter\LessphpFilter());
     $fm->set('cssmin', new Assetic\Filter\CssMinFilter);
     $fm->set('jsmin', new Assetic\Filter\JSMinFilter);
     $fm->set('cssrewrite', new Assetic\Filter\CssRewriteFilter());
},

When Twig is installed, the Assetic Extension can be used. Be sure to include the AsseticServiceProvider AFTER the TwigServiceProvider, (*7)

The Versions