|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Acacha\AdminLTETemplateLaravel\Console; |
|
4
|
|
|
|
|
5
|
|
|
use Illuminate\Console\Command; |
|
6
|
|
|
use Illuminate\Filesystem\Filesystem; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Class PublishAdminLTE. |
|
10
|
|
|
*/ |
|
11
|
|
|
class PublishAdminLTE extends Command |
|
12
|
|
|
{ |
|
13
|
|
|
use Installable; |
|
14
|
|
|
/** |
|
15
|
|
|
* The filesystem instance. |
|
16
|
|
|
* |
|
17
|
|
|
* @var \Illuminate\Filesystem\Filesystem |
|
18
|
|
|
*/ |
|
19
|
|
|
protected $files; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* The name and signature of the console command. |
|
23
|
|
|
*/ |
|
24
|
|
|
protected $signature = 'adminlte-laravel:publish {--f|force : Force overwrite of files}'; |
|
25
|
|
|
|
|
26
|
|
|
/** |
|
27
|
|
|
* The console command description. |
|
28
|
|
|
* |
|
29
|
|
|
* @var string |
|
30
|
|
|
*/ |
|
31
|
|
|
protected $description = 'Publish Acacha AdminLTE Template files into laravel project'; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* Force overwrite of files. |
|
35
|
|
|
* |
|
36
|
|
|
* @var bool |
|
37
|
|
|
*/ |
|
38
|
|
|
protected $force = false; |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* Create a new command instance. |
|
42
|
|
|
* |
|
43
|
|
|
* @param \Illuminate\Filesystem\Filesystem $files |
|
44
|
|
|
* |
|
45
|
|
|
* @return void |
|
|
|
|
|
|
46
|
|
|
*/ |
|
47
|
|
|
public function __construct(Filesystem $files) |
|
48
|
|
|
{ |
|
49
|
|
|
parent::__construct(); |
|
50
|
|
|
$this->files = $files; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* Execute the console command. |
|
55
|
|
|
*/ |
|
56
|
|
View Code Duplication |
public function handle() |
|
|
|
|
|
|
57
|
|
|
{ |
|
58
|
|
|
$this->processOptions(); |
|
59
|
|
|
$this->publishHomeController(); |
|
60
|
|
|
$this->changeRegisterController(); |
|
61
|
|
|
$this->changeLoginController(); |
|
62
|
|
|
$this->changeForgotPasswordController(); |
|
63
|
|
|
$this->changeResetPasswordController(); |
|
64
|
|
|
$this->publishPublicAssets(); |
|
65
|
|
|
$this->publishViews(); |
|
66
|
|
|
$this->publishResourceAssets(); |
|
67
|
|
|
$this->publishTests(); |
|
68
|
|
|
$this->publishLanguages(); |
|
69
|
|
|
$this->publishGravatar(); |
|
70
|
|
|
$this->publishConfig(); |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* Install Home Controller. |
|
75
|
|
|
*/ |
|
76
|
|
|
private function publishHomeController() |
|
77
|
|
|
{ |
|
78
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::homeController()); |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* Change Auth Register controller. |
|
83
|
|
|
*/ |
|
84
|
|
|
private function changeRegisterController() |
|
85
|
|
|
{ |
|
86
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::registerController()); |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
|
|
/** |
|
90
|
|
|
* Change Auth Login controller. |
|
91
|
|
|
*/ |
|
92
|
|
|
private function changeLoginController() |
|
93
|
|
|
{ |
|
94
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::loginController()); |
|
95
|
|
|
} |
|
96
|
|
|
|
|
97
|
|
|
/** |
|
98
|
|
|
* Change Auth Forgot Password controller. |
|
99
|
|
|
*/ |
|
100
|
|
|
private function changeForgotPasswordController() |
|
101
|
|
|
{ |
|
102
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::forgotPasswordController()); |
|
103
|
|
|
} |
|
104
|
|
|
|
|
105
|
|
|
/** |
|
106
|
|
|
* Change Auth Reset Password controller. |
|
107
|
|
|
*/ |
|
108
|
|
|
private function changeResetPasswordController() |
|
109
|
|
|
{ |
|
110
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::resetPasswordController()); |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* Install public assets. |
|
115
|
|
|
*/ |
|
116
|
|
|
private function publishPublicAssets() |
|
117
|
|
|
{ |
|
118
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::publicAssets()); |
|
119
|
|
|
} |
|
120
|
|
|
|
|
121
|
|
|
/** |
|
122
|
|
|
* Install views. |
|
123
|
|
|
*/ |
|
124
|
|
|
private function publishViews() |
|
125
|
|
|
{ |
|
126
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::viewsToOverwrite()); |
|
127
|
|
|
} |
|
128
|
|
|
|
|
129
|
|
|
/** |
|
130
|
|
|
* Install resource assets. |
|
131
|
|
|
*/ |
|
132
|
|
|
private function publishResourceAssets() |
|
133
|
|
|
{ |
|
134
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::resourceAssets()); |
|
135
|
|
|
} |
|
136
|
|
|
|
|
137
|
|
|
/** |
|
138
|
|
|
* Install resource assets. |
|
139
|
|
|
*/ |
|
140
|
|
|
private function publishTests() |
|
141
|
|
|
{ |
|
142
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::tests()); |
|
143
|
|
|
} |
|
144
|
|
|
|
|
145
|
|
|
/** |
|
146
|
|
|
* Install language assets. |
|
147
|
|
|
*/ |
|
148
|
|
|
private function publishLanguages() |
|
149
|
|
|
{ |
|
150
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::languages()); |
|
151
|
|
|
} |
|
152
|
|
|
|
|
153
|
|
|
/** |
|
154
|
|
|
* Install gravatar config file. |
|
155
|
|
|
*/ |
|
156
|
|
|
private function publishGravatar() |
|
157
|
|
|
{ |
|
158
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::gravatar()); |
|
159
|
|
|
} |
|
160
|
|
|
|
|
161
|
|
|
/** |
|
162
|
|
|
* Publish adminlte package config. |
|
163
|
|
|
*/ |
|
164
|
|
|
private function publishConfig() |
|
165
|
|
|
{ |
|
166
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::config()); |
|
167
|
|
|
} |
|
168
|
|
|
|
|
169
|
|
|
/** |
|
170
|
|
|
* Process options before running command. |
|
171
|
|
|
*/ |
|
172
|
|
|
private function processOptions() |
|
173
|
|
|
{ |
|
174
|
|
|
$this->force = $this->option('force'); |
|
|
|
|
|
|
175
|
|
|
} |
|
176
|
|
|
} |
|
177
|
|
|
|
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.