ladybirdweb /
laravel-importer
| 1 | <?php |
||
| 2 | |||
| 3 | namespace LWS\Import; |
||
| 4 | |||
| 5 | use Illuminate\Support\ServiceProvider; |
||
| 6 | |||
| 7 | class ImportServiceProvider extends ServiceProvider |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Perform post-registration booting of services. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function boot() |
||
| 15 | { |
||
| 16 | // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'lws'); |
||
| 17 | // $this->loadViewsFrom(__DIR__.'/../resources/views', 'lws'); |
||
| 18 | $this->loadMigrationsFrom(__DIR__.'/migrations'); |
||
| 19 | // $this->loadRoutesFrom(__DIR__.'/routes.php'); |
||
| 20 | |||
| 21 | // Publishing is only necessary when using the CLI. |
||
| 22 | if ($this->app->runningInConsole()) { |
||
| 23 | $this->bootForConsole(); |
||
| 24 | } |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Register any package services. |
||
| 29 | * |
||
| 30 | * @return void |
||
| 31 | */ |
||
| 32 | public function register() |
||
| 33 | { |
||
| 34 | $this->mergeConfigFrom(__DIR__.'/config/import.php', 'import'); |
||
| 35 | |||
| 36 | // Register the service the package provides. |
||
| 37 | $this->app->singleton('import', function ($app) { |
||
|
0 ignored issues
–
show
|
|||
| 38 | return new Import; |
||
| 39 | }); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Get the services provided by the provider. |
||
| 44 | * |
||
| 45 | * @return array |
||
| 46 | */ |
||
| 47 | public function provides() |
||
| 48 | { |
||
| 49 | return ['import']; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Console-specific booting. |
||
| 54 | * |
||
| 55 | * @return void |
||
| 56 | */ |
||
| 57 | protected function bootForConsole() |
||
| 58 | { |
||
| 59 | // Publishing the configuration file. |
||
| 60 | $this->publishes([ |
||
| 61 | __DIR__.'/config/import.php' => config_path('import.php'), |
||
| 62 | ], 'import.config'); |
||
| 63 | |||
| 64 | // Publishing the views. |
||
| 65 | /*$this->publishes([ |
||
| 66 | __DIR__.'/../resources/views' => base_path('resources/views/vendor/lws'), |
||
| 67 | ], 'import.views');*/ |
||
| 68 | |||
| 69 | // Publishing assets. |
||
| 70 | /*$this->publishes([ |
||
| 71 | __DIR__.'/../resources/assets' => public_path('vendor/lws'), |
||
| 72 | ], 'import.views');*/ |
||
| 73 | |||
| 74 | // Publishing the translation files. |
||
| 75 | /*$this->publishes([ |
||
| 76 | __DIR__.'/../resources/lang' => resource_path('lang/vendor/lws'), |
||
| 77 | ], 'import.views');*/ |
||
| 78 | |||
| 79 | // Registering package commands. |
||
| 80 | // $this->commands([]); |
||
| 81 | } |
||
| 82 | } |
||
| 83 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.