| 1 | <?php namespace C4tech\RayEmitter; |
||
| 7 | class ServiceProvider extends BaseServiceProvider |
||
| 8 | { |
||
| 9 | protected $configPath = ''; |
||
| 10 | |||
| 11 | protected $migrationPath = ''; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @inheritDoc |
||
| 15 | */ |
||
| 16 | 4 | public function __construct($app) |
|
| 17 | { |
||
| 18 | 4 | $this->configPath = __DIR__ . '/../resources/config.php'; |
|
| 19 | 4 | $this->migrationPath = __DIR__ . '/../resources/migrations'; |
|
| 20 | |||
| 21 | 4 | parent::__construct($app); |
|
| 22 | 4 | } |
|
| 23 | |||
| 24 | /** |
||
| 25 | * @inheritDoc |
||
| 26 | */ |
||
| 27 | 1 | public function boot() |
|
| 28 | { |
||
| 29 | 1 | $configs = []; |
|
| 30 | 1 | $configs[$this->configPath] = config_path('ray_emitter.php'); |
|
| 31 | 1 | $this->publishes($configs, 'config'); |
|
| 32 | |||
| 33 | 1 | $migrations = []; |
|
| 34 | 1 | $migrations[$this->migrationPath] = database_path('migrations'); |
|
| 35 | 1 | $this->publishes($migrations, 'migrations'); |
|
| 36 | 1 | } |
|
| 37 | |||
| 38 | /** |
||
| 39 | * @inheritDoc |
||
| 40 | */ |
||
| 41 | 1 | public function register() |
|
| 42 | { |
||
| 43 | 1 | $this->mergeConfigFrom($this->configPath, 'ray_emitter'); |
|
| 44 | |||
| 45 | 1 | App::singleton( |
|
| 46 | 1 | 'rayemitter.store', |
|
| 47 | 1 | function () { |
|
| 48 | 1 | return new Store; |
|
| 49 | } |
||
| 50 | 1 | ); |
|
| 51 | 1 | } |
|
| 52 | |||
| 53 | /** |
||
| 54 | * @inheritDoc |
||
| 55 | */ |
||
| 56 | 1 | public function provides() |
|
| 60 | } |
||
| 61 |