1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Acacha\AdminLTETemplateLaravel\Console; |
4
|
|
|
|
5
|
|
|
use Illuminate\Console\Command; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class AdminLTE. |
9
|
|
|
*/ |
10
|
|
|
class AdminLTE extends Command |
11
|
|
|
{ |
12
|
|
|
/** |
13
|
|
|
* The name and signature of the console command. |
14
|
|
|
*/ |
15
|
|
|
protected $signature = 'adminlte-laravel:install'; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* The console command description. |
19
|
|
|
* |
20
|
|
|
* @var string |
21
|
|
|
*/ |
22
|
|
|
protected $description = 'Install Acacha AdminLTE Template into fresh laravel project'; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* Execute the console command. |
26
|
|
|
* |
27
|
|
|
* @return mixed |
28
|
|
|
*/ |
29
|
|
|
public function handle() |
30
|
|
|
{ |
31
|
|
|
$this->installHomeController(); |
32
|
|
|
$this->installRegisterController(); |
33
|
|
|
$this->installPublicAssets(); |
34
|
|
|
$this->installViews(); |
35
|
|
|
$this->installResourceAssets(); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* Install Home Controller. |
40
|
|
|
*/ |
41
|
|
|
private function installHomeController() |
42
|
|
|
{ |
43
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::homeController()); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* Install Auth controller. |
48
|
|
|
*/ |
49
|
|
|
private function installRegisterController() |
50
|
|
|
{ |
51
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::registerController()); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Install public assets. |
56
|
|
|
*/ |
57
|
|
|
private function installPublicAssets() |
58
|
|
|
{ |
59
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::publicAssets()); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* Install views. |
64
|
|
|
*/ |
65
|
|
|
private function installViews() |
66
|
|
|
{ |
67
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::views()); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* Install resource assets. |
72
|
|
|
*/ |
73
|
|
|
private function installResourceAssets() |
74
|
|
|
{ |
75
|
|
|
$this->install(\Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::resourceAssets()); |
76
|
|
|
} |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* Install files from array. |
80
|
|
|
* |
81
|
|
|
* @param $files |
82
|
|
|
*/ |
83
|
|
|
private function install($files) |
84
|
|
|
{ |
85
|
|
|
foreach ($files as $fileSrc => $fileDst) { |
86
|
|
|
copy($fileSrc, $fileDst); |
87
|
|
|
} |
88
|
|
|
} |
89
|
|
|
} |
90
|
|
|
|