CodeSleeve / asset-pipeline

This Laravel 4 package provides a very simple and easy to use asset pipeline. It was heavily inspired by the Rails asset pipeline. We make use of the wonderful Assetic package to help with pre-compliation!
http://www.codesleeve.com
MIT License
491 stars 53 forks source link

Do not use facades #198

Open franzliedke opened 9 years ago

franzliedke commented 9 years ago

There's no reason to use facades in a service provider (as is done by including routes.php).

I'd suggest just moving the code in routes.php to the service provider - as it's just three lines - and then accessing the router and config through the app object, like so:

$app = $this->app;
$app['router']->group($app['config']->get('asset-pipeline::routing'), function() use ($app) {
    $app['router']->get('{path}', $app['config']->get('asset-pipeline::controller_action'))->where('path', '.*');
});
franzliedke commented 9 years ago

Any thoughts on this? =)