1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Darkgoldblade01\StatusCheck; |
4
|
|
|
|
5
|
|
|
use Illuminate\Support\ServiceProvider; |
6
|
|
|
|
7
|
|
|
class StatusCheckServiceProvider extends ServiceProvider |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* Bootstrap the application services. |
11
|
|
|
*/ |
12
|
|
|
public function boot() |
13
|
|
|
{ |
14
|
|
|
/* |
15
|
|
|
* Optional methods to load your package assets |
16
|
|
|
*/ |
17
|
|
|
// $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'status-check'); |
18
|
|
|
// $this->loadViewsFrom(__DIR__.'/../resources/views', 'status-check'); |
19
|
|
|
$this->loadMigrationsFrom(__DIR__.'/database/migrations'); |
20
|
|
|
// $this->loadRoutesFrom(__DIR__.'/routes.php'); |
21
|
|
|
|
22
|
|
|
if ($this->app->runningInConsole()) { |
23
|
|
|
$this->publishes([ |
24
|
|
|
__DIR__.'/../config/config.php' => config_path('status-check.php'), |
25
|
|
|
], 'config'); |
26
|
|
|
|
27
|
|
|
// Publishing the views. |
28
|
|
|
/*$this->publishes([ |
29
|
|
|
__DIR__.'/../resources/views' => resource_path('views/vendor/status-check'), |
30
|
|
|
], 'views');*/ |
31
|
|
|
|
32
|
|
|
// Publishing assets. |
33
|
|
|
/*$this->publishes([ |
34
|
|
|
__DIR__.'/../resources/assets' => public_path('vendor/status-check'), |
35
|
|
|
], 'assets');*/ |
36
|
|
|
|
37
|
|
|
// Publishing the translation files. |
38
|
|
|
/*$this->publishes([ |
39
|
|
|
__DIR__.'/../resources/lang' => resource_path('lang/vendor/status-check'), |
40
|
|
|
], 'lang');*/ |
41
|
|
|
|
42
|
|
|
// Publishing the database migrations. |
43
|
|
|
// $this->publishes([ |
44
|
|
|
// __DIR__.'/database/migrations' => app_path('database/migrations'), |
45
|
|
|
// ], 'lang'); |
46
|
|
|
|
47
|
|
|
// Registering package commands. |
48
|
|
|
$this->commands([ |
49
|
|
|
\Darkgoldblade01\StatusCheck\Commands\StatusCheck::class, |
50
|
|
|
]); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
StatusCheck::registerEvents(); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Register the application services. |
58
|
|
|
*/ |
59
|
|
|
public function register() |
60
|
|
|
{ |
61
|
|
|
// Automatically apply the package configuration |
62
|
|
|
$this->mergeConfigFrom(__DIR__.'/../config/config.php', 'status-check'); |
63
|
|
|
|
64
|
|
|
// Register the main class to use with the facade |
65
|
|
|
$this->app->singleton('status-check', function () { |
66
|
|
|
return new StatusCheck; |
67
|
|
|
}); |
68
|
|
|
} |
69
|
|
|
} |
70
|
|
|
|