1 | <?php |
||
23 | class MakeAuthCommand extends Command |
||
24 | { |
||
25 | use DetectsApplicationNamespace; |
||
26 | |||
27 | /** |
||
28 | * The name and signature of the console command. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $signature = 'make:auth {--views : Only scaffold the authentication views}'; |
||
33 | |||
34 | /** |
||
35 | * The console command description. |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $description = 'Scaffold basic login and registration views and routes'; |
||
40 | |||
41 | /** |
||
42 | * The controllers that need to be exported. |
||
43 | * |
||
44 | * @var array |
||
45 | */ |
||
46 | protected $controllers = [ |
||
47 | |||
48 | 'Backend/AbilitiesController', |
||
49 | 'Backend/DashboardController', |
||
50 | 'Backend/RolesController', |
||
51 | 'Backend/UsersController', |
||
52 | |||
53 | 'Frontend/AccountSettingsController', |
||
54 | 'Frontend/AccountSessionsController', |
||
55 | 'Frontend/AuthenticationController', |
||
56 | 'Frontend/EmailVerificationController', |
||
57 | 'Frontend/PasswordResetController', |
||
58 | 'Frontend/PhoneVerificationController', |
||
59 | 'Frontend/RegistrationController', |
||
60 | 'Frontend/SocialAuthenticationController', |
||
61 | 'Frontend/TwoFactorSettingsController', |
||
62 | |||
63 | 'AbstractController', |
||
64 | 'AuthenticatedController', |
||
65 | 'AuthorizedController', |
||
66 | |||
67 | ]; |
||
68 | |||
69 | /** |
||
70 | * The requests that need to be exported. |
||
71 | * |
||
72 | * @var array |
||
73 | */ |
||
74 | protected $requests = [ |
||
75 | |||
76 | 'Frontend/EmailVerificationRequest', |
||
77 | 'Frontend/PasswordResetRequest', |
||
78 | 'Frontend/PasswordResetSendRequest', |
||
79 | 'Frontend/PhoneVerificationRequest', |
||
80 | 'Frontend/PhoneVerificationSendRequest', |
||
81 | 'Frontend/UserAuthenticationRequest', |
||
82 | |||
83 | ]; |
||
84 | |||
85 | /** |
||
86 | * The views that need to be exported. |
||
87 | * |
||
88 | * @var array |
||
89 | */ |
||
90 | protected $views = [ |
||
91 | |||
92 | 'backend/abilities/form.blade', |
||
93 | 'backend/abilities/index.blade', |
||
94 | 'backend/common/confirm-modal.blade', |
||
95 | 'backend/common/layout.blade', |
||
96 | 'backend/common/layout-example.blade', |
||
97 | 'backend/common/pagination.blade', |
||
98 | 'backend/dashboard/home.blade', |
||
99 | 'backend/roles/form.blade', |
||
100 | 'backend/roles/index.blade', |
||
101 | 'backend/users/form.blade', |
||
102 | 'backend/users/index.blade', |
||
103 | |||
104 | 'frontend/account/sessions.blade', |
||
105 | 'frontend/account/settings.blade', |
||
106 | 'frontend/account/twofactor.blade', |
||
107 | 'frontend/alerts/error.blade', |
||
108 | 'frontend/alerts/success.blade', |
||
109 | 'frontend/alerts/warning.blade', |
||
110 | 'frontend/authentication/login.blade', |
||
111 | 'frontend/authentication/register.blade', |
||
112 | 'frontend/common/confirm-modal.blade', |
||
113 | 'frontend/common/layout.blade', |
||
114 | 'frontend/common/layout-example.blade', |
||
115 | 'frontend/passwordreset/request.blade', |
||
116 | 'frontend/passwordreset/reset.blade', |
||
117 | 'frontend/verification/email-request.blade', |
||
118 | 'frontend/verification/phone-request.blade', |
||
119 | 'frontend/verification/phone-token.blade', |
||
120 | |||
121 | ]; |
||
122 | |||
123 | /** |
||
124 | * The language files that need to be exported. |
||
125 | * |
||
126 | * @var array |
||
127 | */ |
||
128 | protected $langs = [ |
||
129 | |||
130 | 'en/common.php', |
||
131 | 'en/emails.php', |
||
132 | 'en/messages.php', |
||
133 | 'en/twofactor.php', |
||
134 | |||
135 | ]; |
||
136 | |||
137 | /** |
||
138 | * Execute the console command. |
||
139 | * |
||
140 | * @return void |
||
141 | */ |
||
142 | public function fire() |
||
155 | |||
156 | /** |
||
157 | * Export the views. |
||
158 | * |
||
159 | * @return void |
||
160 | */ |
||
161 | protected function exportViews() |
||
176 | |||
177 | /** |
||
178 | * Export the language files. |
||
179 | * |
||
180 | * @return void |
||
181 | */ |
||
182 | protected function exportLangs() |
||
197 | |||
198 | /** |
||
199 | * Export the controllers. |
||
200 | * |
||
201 | * @return void |
||
202 | */ |
||
203 | protected function exportControllers() |
||
218 | |||
219 | /** |
||
220 | * Export the requests. |
||
221 | * |
||
222 | * @return void |
||
223 | */ |
||
224 | protected function exportRequests() |
||
239 | |||
240 | /** |
||
241 | * Export the routes. |
||
242 | * |
||
243 | * @return void |
||
244 | */ |
||
245 | protected function exportRoutes() |
||
252 | |||
253 | /** |
||
254 | * Compiles the class stub. |
||
255 | * |
||
256 | * @param string $stub |
||
257 | * |
||
258 | * @return string |
||
259 | */ |
||
260 | protected function compileClassStub($stub) |
||
264 | } |
||
265 |