1 | <?php |
||
8 | class HashidServiceProvider extends ServiceProvider |
||
9 | { |
||
10 | /** |
||
11 | * Register the service provider. |
||
12 | * |
||
13 | * @return void |
||
14 | */ |
||
15 | 6 | public function register() |
|
22 | |||
23 | /** |
||
24 | * Setup package assets. |
||
25 | * |
||
26 | * @return void |
||
27 | */ |
||
28 | 6 | protected function setupAssets() |
|
29 | { |
||
30 | 6 | if (is_a($this->app, 'Laravel\Lumen\Application')) { |
|
31 | $this->app->configure('hashid'); |
||
32 | } |
||
33 | |||
34 | 6 | $this->mergeConfigFrom($config = __DIR__.'/../config/hashid.php', 'hashid'); |
|
35 | |||
36 | 6 | if ($this->app->runningInConsole()) { |
|
37 | 6 | $this->publishes([$config => base_path('config/hashid.php')], 'hashid'); |
|
38 | 6 | } |
|
39 | 6 | } |
|
40 | |||
41 | /** |
||
42 | * Register service bindings. |
||
43 | * |
||
44 | * @return void |
||
45 | */ |
||
46 | 6 | protected function registerServices() |
|
64 | |||
65 | /** |
||
66 | * Create a new instance from class name. |
||
67 | * |
||
68 | * @param string $class |
||
69 | * @param array $args |
||
70 | * @return mixed |
||
71 | */ |
||
72 | 4 | protected function createInstance($class, array $args = []) |
|
79 | |||
80 | /** |
||
81 | * Get singleton bindings to be registered. |
||
82 | * |
||
83 | * @return array |
||
84 | */ |
||
85 | 6 | protected function getSingletonBindings() |
|
95 | |||
96 | /** |
||
97 | * Get class aliases to be registered. |
||
98 | * |
||
99 | * @return array |
||
100 | */ |
||
101 | 6 | protected function getClassAliases() |
|
113 | |||
114 | /** |
||
115 | * Register console commands. |
||
116 | * |
||
117 | * @return void |
||
118 | */ |
||
119 | 6 | protected function registerCommands() |
|
128 | } |
||
129 |