1
|
|
|
<?php namespace Arcanedev\LogViewer; |
2
|
|
|
|
3
|
|
|
use Arcanedev\Support\PackageServiceProvider; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Class LogViewerServiceProvider |
7
|
|
|
* |
8
|
|
|
* @package Arcanedev\LogViewer |
9
|
|
|
* @author ARCANEDEV <[email protected]> |
10
|
|
|
*/ |
11
|
|
|
class LogViewerServiceProvider extends PackageServiceProvider |
12
|
|
|
{ |
13
|
|
|
/* ----------------------------------------------------------------- |
14
|
|
|
| Properties |
15
|
|
|
| ----------------------------------------------------------------- |
16
|
|
|
*/ |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Package name. |
20
|
|
|
* |
21
|
|
|
* @var string |
22
|
|
|
*/ |
23
|
|
|
protected $package = 'log-viewer'; |
24
|
|
|
|
25
|
|
|
/* ----------------------------------------------------------------- |
26
|
|
|
| Main Methods |
27
|
|
|
| ----------------------------------------------------------------- |
28
|
|
|
*/ |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* Register the service provider. |
32
|
|
|
*/ |
33
|
411 |
|
public function register() |
34
|
|
|
{ |
35
|
411 |
|
parent::register(); |
36
|
|
|
|
37
|
411 |
|
$this->registerConfig(); |
38
|
|
|
|
39
|
411 |
|
$this->registerLogViewer(); |
40
|
411 |
|
$this->registerAliases(); |
41
|
|
|
|
42
|
411 |
|
$this->registerProviders([ |
43
|
411 |
|
Providers\UtilitiesServiceProvider::class, |
44
|
137 |
|
Providers\RouteServiceProvider::class, |
45
|
137 |
|
]); |
46
|
411 |
|
$this->registerConsoleServiceProvider(Providers\CommandsServiceProvider::class); |
47
|
411 |
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Boot the service provider. |
51
|
|
|
*/ |
52
|
411 |
|
public function boot() |
53
|
|
|
{ |
54
|
411 |
|
parent::boot(); |
55
|
|
|
|
56
|
411 |
|
$this->publishConfig(); |
57
|
411 |
|
$this->publishViews(); |
58
|
411 |
|
$this->publishTranslations(); |
59
|
411 |
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Get the services provided by the provider. |
63
|
|
|
* |
64
|
|
|
* @return array |
65
|
|
|
*/ |
66
|
3 |
|
public function provides() |
67
|
|
|
{ |
68
|
|
|
return [ |
69
|
3 |
|
Contracts\LogViewer::class, |
70
|
1 |
|
]; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/* ----------------------------------------------------------------- |
74
|
|
|
| Other Methods |
75
|
|
|
| ----------------------------------------------------------------- |
76
|
|
|
*/ |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Register the log data class. |
80
|
|
|
*/ |
81
|
411 |
|
private function registerLogViewer() |
82
|
|
|
{ |
83
|
411 |
|
$this->singleton(Contracts\LogViewer::class, LogViewer::class); |
84
|
|
|
|
85
|
|
|
// Registering the Facade |
86
|
411 |
|
$this->alias( |
87
|
411 |
|
$this->config()->get('log-viewer.facade', 'LogViewer'), |
88
|
274 |
|
Facades\LogViewer::class |
89
|
137 |
|
); |
90
|
411 |
|
} |
91
|
|
|
} |
92
|
|
|
|