1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ikechukwukalu\Magicmake\Console\Commands; |
4
|
|
|
|
5
|
|
|
class MagicInitCommand extends InitCommands |
6
|
|
|
{ |
7
|
|
|
/** |
8
|
|
|
* The name and signature of the console command. |
9
|
|
|
* |
10
|
|
|
* @var string |
11
|
|
|
*/ |
12
|
|
|
protected $signature = 'magic:init'; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* The console command description. |
16
|
|
|
* |
17
|
|
|
* @var string |
18
|
|
|
*/ |
19
|
|
|
protected $description = 'Scaffold the numerous classes'; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Execute the console command. |
23
|
|
|
* |
24
|
|
|
* @return void |
25
|
|
|
*/ |
26
|
|
|
public function handle() |
27
|
|
|
{ |
28
|
|
|
if (env('APP_ENV', 'production') != 'local') { |
|
|
|
|
29
|
|
|
return; |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
if (env('MAGIC_INIT_LOCK', true) === true) { |
33
|
|
|
return; |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
$this->handleAppActionPath(); |
37
|
|
|
$this->handleAppContractsPath(); |
38
|
|
|
$this->handleAppEnumsPath(); |
39
|
|
|
$this->handleAppEventsPath(); |
40
|
|
|
$this->handleAppExceptionsPath(); |
41
|
|
|
$this->handleAppHttpPath(); |
42
|
|
|
$this->handleAppHttpControllersPath(); |
43
|
|
|
$this->handleAppHttpControllersAuthPath(); |
44
|
|
|
$this->handleAppHttpMiddlewarePath(); |
45
|
|
|
$this->handleAppHttpRequestsPath(); |
46
|
|
|
$this->handleAppHttpRequestsAuthPath(); |
47
|
|
|
$this->handleAppListenersPath(); |
48
|
|
|
$this->handleAppModelsPath(); |
49
|
|
|
$this->handleAppModelsScopesPath(); |
50
|
|
|
$this->handleAppNotificationsPath(); |
51
|
|
|
$this->handleAppProvidersPath(); |
52
|
|
|
$this->handleAppRepositoriesPath(); |
53
|
|
|
$this->handleAppRulesPath(); |
54
|
|
|
$this->handleAppServicesPath(); |
55
|
|
|
$this->handleAppServicesAuthPath(); |
56
|
|
|
$this->handleAppTraitsPath(); |
57
|
|
|
|
58
|
|
|
$this->handleConfigPath(); |
59
|
|
|
|
60
|
|
|
$this->handleDatabasePath(); |
61
|
|
|
|
62
|
|
|
$this->handleLangPath(); |
63
|
|
|
|
64
|
|
|
$this->handleRoutesPath(); |
65
|
|
|
|
66
|
|
|
$this->handleTestsPath(); |
67
|
|
|
|
68
|
|
|
$this->handleResourcesPath(); |
69
|
|
|
|
70
|
|
|
$this->callSilently("vendor:publish", ["--provider" => "Laragear\TwoFactor\TwoFactorServiceProvider"]); |
71
|
|
|
$this->components->info("Laragear TwoFactor migration and config file published"); |
72
|
|
|
|
73
|
|
|
$this->callSilently("vendor:publish", ["--provider" => "Spatie\Activitylog\ActivitylogServiceProvider", "--tag" => "activitylog-migrations"]); |
74
|
|
|
$this->components->info("Spatie ActivityLog migration and config file published"); |
75
|
|
|
|
76
|
|
|
$this->callSilently("vendor:publish", ["--provider" => "Spatie\Permission\PermissionServiceProvider"]); |
77
|
|
|
$this->components->info("Spatie Permissions migration and config file published"); |
78
|
|
|
} |
79
|
|
|
} |
80
|
|
|
|