1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Created by PhpStorm. |
4
|
|
|
* User: imokhles |
5
|
|
|
* Date: 2019-05-27 |
6
|
|
|
* Time: 12:37 |
7
|
|
|
*/ |
8
|
|
|
|
9
|
|
|
namespace iMokhles\MultiAuthCommand\Command; |
10
|
|
|
|
11
|
|
|
use Illuminate\Database\Console\Migrations\BaseCommand; |
12
|
|
|
|
13
|
|
|
class MultiAuthListThemes extends BaseCommand |
14
|
|
|
{ |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* The name and signature of the console command. |
18
|
|
|
* |
19
|
|
|
* @var string |
20
|
|
|
*/ |
21
|
|
|
protected $signature = 'make:multi_auth:list_themes'; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* The console command description. |
25
|
|
|
* |
26
|
|
|
* @var string |
27
|
|
|
*/ |
28
|
|
|
protected $description = 'list MultiAuthCommand supported themes'; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var |
32
|
|
|
*/ |
33
|
|
|
protected $progressBar; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Execute the console command. |
37
|
|
|
* |
38
|
|
|
* @return boolean |
39
|
|
|
*/ |
40
|
|
|
public function handle() |
41
|
|
|
{ |
42
|
|
|
$themes = self::listSupportedThemes(); |
43
|
|
|
|
44
|
|
|
$this->progressBar = $this->output->createProgressBar(count($themes)); |
45
|
|
|
$this->progressBar->start(); |
46
|
|
|
|
47
|
|
|
$this->line(" Listing supported themes. Please wait..."); |
48
|
|
|
$this->progressBar->advance(); |
49
|
|
|
|
50
|
|
|
foreach ($themes as $theme => $link) { |
51
|
|
|
$this->line(" THEME_NAME: $theme\nTHEME_LINK: $link\n"); |
52
|
|
|
$this->progressBar->advance(); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
$this->progressBar->finish(); |
56
|
|
|
$this->info(" Finished listed themes."); |
57
|
|
|
return true; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @return array |
|
|
|
|
62
|
|
|
*/ |
63
|
|
|
public static function githubLinksForFreeThemes() { |
64
|
|
|
return [ |
65
|
|
|
'adminlte2' => 'https://github.com/ColorlibHQ/AdminLTE/archive/master.zip', |
66
|
|
|
'tabler' => 'https://github.com/tabler/tabler/archive/master.zip', |
67
|
|
|
]; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return array |
|
|
|
|
72
|
|
|
*/ |
73
|
|
|
public static function listFreeThemes() { |
74
|
|
|
return [ |
75
|
|
|
'adminlte2' => 'https://adminlte.io/themes/AdminLTE/index2.html', |
76
|
|
|
'tabler' => 'https://preview.tabler.io/', |
77
|
|
|
]; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @return array |
|
|
|
|
82
|
|
|
*/ |
83
|
|
|
public static function listPaidThemes() { |
84
|
|
|
return [ |
85
|
|
|
'highadmin' => 'https://themeforest.net/item/highdmin-responsive-bootstrap-4-admin-dashboard/21233941', |
86
|
|
|
'startui' => 'https://themeforest.net/item/startui-premium-bootstrap-4-admin-dashboard-template/15228250', |
87
|
|
|
'oneui' => 'https://themeforest.net/item/oneui-bootstrap-admin-dashboard-template-ui-framework-angularjs/11820082', |
88
|
|
|
]; |
89
|
|
|
} |
90
|
|
|
/** |
91
|
|
|
* @return array |
|
|
|
|
92
|
|
|
*/ |
93
|
|
|
public static function listSupportedThemes() { |
94
|
|
|
|
95
|
|
|
return array_merge(self::listFreeThemes(), self::listPaidThemes()); |
96
|
|
|
} |
97
|
|
|
} |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.