1 <?php namespace CupOfTea\EasyCfg;
2
3 use Blade;
4
5 use CupOfTea\EasyCfg\Contracts\Provider as ProviderContract;
6
7 use Illuminate\Support\ServiceProvider;
8
9 class EasyCfgServiceProvider extends ServiceProvider
10 {
11
12 13 14 15 16
17 protected $defer = false;
18
19 20 21 22 23
24 public function boot()
25 {
26 $this->publishes([
27 __DIR__.'/../database/migrations/' => base_path('/database/migrations')
28 ], 'migrations');
29
30 $this->publishes([
31 __DIR__.'/../config/easycfg.php' => config_path('easycfg.php'),
32 ], 'config');
33
34 Blade::extend([with(new Compiler), 'compile']);
35 }
36
37 38 39 40 41
42 public function register()
43 {
44 $this->mergeConfigFrom(
45 __DIR__.'/../config/easycfg.php', 'easycfg'
46 );
47
48 $this->app->singleton(ProviderContract::class, EasyCfg::class);
49 }
50
51 52 53 54 55
56 public function provides()
57 {
58 return [
59 ProviderContract::class,
60 ];
61 }
62
63 }
64