-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathLegacyServiceProvider.php
50 lines (42 loc) · 1.34 KB
/
LegacyServiceProvider.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php namespace Stolz\Assets\Laravel;
use Stolz\Assets\Manager as Assets;
use Illuminate\Foundation\AliasLoader;
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
class LegacyServiceProvider extends LaravelServiceProvider
{
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
// Register the package namespace
//$this->package('stolz/assets'); // Only valid if config file is at src/config/config.php
$this->app->config->package('stolz/assets', __DIR__, 'assets');
// Read settings from config file
$config = $this->app->config->get('assets::config', []);
// Apply config settings
$this->app['stolz.assets.group.default']->config($config);
// Add 'Assets' facade alias
AliasLoader::getInstance()->alias('Assets', 'Stolz\Assets\Laravel\Facade');
// Add artisan command
$this->commands('stolz.assets.command.flush');
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
// Bind 'stolz.assets.group.default' shared component to the IoC container
$this->app->singleton('stolz.assets.group.default', function ($app) {
return new Assets();
});
// Bind 'stolz.assets.command.flush' component to the IoC container
$this->app->bind('stolz.assets.command.flush', function ($app) {
return new LegacyFlushPipelineCommand();
});
}
}