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