fomvasss /
laravel-currency
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Fomvasss\Currency; |
||
| 4 | |||
| 5 | class ServiceProvider extends \Illuminate\Support\ServiceProvider |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Bootstrap the application services. |
||
| 9 | * |
||
| 10 | * @return void |
||
| 11 | */ |
||
| 12 | public function boot() |
||
| 13 | { |
||
| 14 | $this->publishes([ |
||
| 15 | __DIR__.'/../config/currency.php' => config_path('currency.php') |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 16 | ], 'config'); |
||
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Register the application services. |
||
| 21 | * |
||
| 22 | * @return void |
||
| 23 | */ |
||
| 24 | public function register() |
||
| 25 | { |
||
| 26 | $this->mergeConfigFrom(__DIR__.'/../config/currency.php', 'currency'); |
||
| 27 | |||
| 28 | $this->registerCurrency(); |
||
| 29 | |||
| 30 | } |
||
| 31 | |||
| 32 | public function registerCurrency() |
||
| 33 | { |
||
| 34 | $this->app->singleton('currency', function ($app) { |
||
| 35 | return new Currency($app->config->get('currency', [])); |
||
| 36 | }); |
||
| 37 | |||
| 38 | $this->app->alias(Currency::class, 'fomvasss-currency'); |
||
| 39 | } |
||
| 40 | } |
||
| 41 |