|
@@ -164,7 +164,7 @@ discard block |
|
|
block discarded – undo |
164
|
164
|
|
165
|
165
|
|
166
|
166
|
|
167
|
|
- $modelTableContent = file_get_contents(__DIR__ . '/../Migration/modelTable.stub'); |
|
167
|
+ $modelTableContent = file_get_contents(__DIR__.'/../Migration/modelTable.stub'); |
168
|
168
|
$modelTableContentNew = str_replace([ |
169
|
169
|
'{{$namePlural}}', |
170
|
170
|
'{{$nameSmallPlural}}', |
|
@@ -174,7 +174,7 @@ discard block |
|
|
block discarded – undo |
174
|
174
|
], $modelTableContent); |
175
|
175
|
|
176
|
176
|
|
177
|
|
- $modelResetPasswordTableContent = file_get_contents(__DIR__ . '/../Migration/passwordResetsTable.stub'); |
|
177
|
+ $modelResetPasswordTableContent = file_get_contents(__DIR__.'/../Migration/passwordResetsTable.stub'); |
178
|
178
|
$modelResetPasswordTableContentNew = str_replace([ |
179
|
179
|
'{{$namePlural}}', |
180
|
180
|
'{{$nameSmallPlural}}', |
|
@@ -184,12 +184,12 @@ discard block |
|
|
block discarded – undo |
184
|
184
|
], $modelResetPasswordTableContent); |
185
|
185
|
|
186
|
186
|
|
187
|
|
- $migrationName = date('Y_m_d_His') . '_'.'create_' . str_plural(snake_case($name)) .'_table.php'; |
|
187
|
+ $migrationName = date('Y_m_d_His').'_'.'create_'.str_plural(snake_case($name)).'_table.php'; |
188
|
188
|
$migrationModelPath = $this->getMigrationPath().DIRECTORY_SEPARATOR.$migrationName; |
189
|
189
|
file_put_contents($migrationModelPath, $modelTableContentNew); |
190
|
190
|
|
191
|
|
- $migrationResetName = date('Y_m_d_His') . '_' |
192
|
|
- .'create_' . str_plural(snake_case($name)) |
|
191
|
+ $migrationResetName = date('Y_m_d_His').'_' |
|
192
|
+ .'create_'.str_plural(snake_case($name)) |
193
|
193
|
.'_password_resets_table.php'; |
194
|
194
|
$migrationResetModelPath = $this->getMigrationPath().DIRECTORY_SEPARATOR.$migrationResetName; |
195
|
195
|
file_put_contents($migrationResetModelPath, $modelResetPasswordTableContentNew); |
|
@@ -223,7 +223,7 @@ discard block |
|
|
block discarded – undo |
223
|
223
|
array_push($newChanges, $nameSmallPlural); |
224
|
224
|
array_push($newChanges, $nameSmall); |
225
|
225
|
|
226
|
|
- $modelContent = file_get_contents(__DIR__ . '/../Backpack/Model/model.stub'); |
|
226
|
+ $modelContent = file_get_contents(__DIR__.'/../Backpack/Model/model.stub'); |
227
|
227
|
$modelContentNew = str_replace($arrayToChange, $newChanges, $modelContent); |
228
|
228
|
|
229
|
229
|
$createFolder = $this->getAppFolderPath().DIRECTORY_SEPARATOR."Models"; |
|
@@ -236,7 +236,7 @@ discard block |
|
|
block discarded – undo |
236
|
236
|
|
237
|
237
|
|
238
|
238
|
|
239
|
|
- $resetNotificationContent = file_get_contents(__DIR__ . '/../Notification/resetPasswordNotification.stub'); |
|
239
|
+ $resetNotificationContent = file_get_contents(__DIR__.'/../Notification/resetPasswordNotification.stub'); |
240
|
240
|
$resetNotificationContentNew = str_replace([ |
241
|
241
|
'{{$name}}', |
242
|
242
|
'{{$nameSmall}}', |
|
@@ -245,7 +245,7 @@ discard block |
|
|
block discarded – undo |
245
|
245
|
$nameSmall |
246
|
246
|
], $resetNotificationContent); |
247
|
247
|
|
248
|
|
- $verifyEmailContent = file_get_contents(__DIR__ . '/../Notification/verifyEmailNotification.stub'); |
|
248
|
+ $verifyEmailContent = file_get_contents(__DIR__.'/../Notification/verifyEmailNotification.stub'); |
249
|
249
|
$verifyEmailContentNew = str_replace([ |
250
|
250
|
'{{$name}}', |
251
|
251
|
'{{$nameSmall}}', |
|
@@ -279,14 +279,14 @@ discard block |
|
|
block discarded – undo |
279
|
279
|
$nameSmall = snake_case($this->getParsedNameInput()); |
280
|
280
|
$name = ucfirst($this->getParsedNameInput()); |
281
|
281
|
|
282
|
|
- $appBlade = file_get_contents(__DIR__ . '/../Backpack/Views/AdminLTE/layouts/layout.blade.stub'); |
283
|
|
- $appGuestBlade = file_get_contents(__DIR__ . '/../Backpack/Views/AdminLTE/layouts/layout_guest.blade.stub'); |
284
|
|
- $homeBlade = file_get_contents(__DIR__ . '/../Backpack/Views/AdminLTE/home.blade.stub'); |
285
|
|
- $loginBlade = file_get_contents(__DIR__ . '/../Backpack/Views/AdminLTE/auth/login.blade.stub'); |
286
|
|
- $registerBlade = file_get_contents(__DIR__ . '/../Backpack/Views/AdminLTE/auth/register.blade.stub'); |
287
|
|
- $resetBlade = file_get_contents(__DIR__ . '/../Backpack/Views/AdminLTE/auth/passwords/reset.blade.stub'); |
288
|
|
- $emailBlade = file_get_contents(__DIR__ . '/../Backpack/Views/AdminLTE/auth/passwords/email.blade.stub'); |
289
|
|
- $verifyEmailBlade = file_get_contents(__DIR__ . '/../Backpack/Views/AdminLTE/auth/verify.blade.stub'); |
|
282
|
+ $appBlade = file_get_contents(__DIR__.'/../Backpack/Views/AdminLTE/layouts/layout.blade.stub'); |
|
283
|
+ $appGuestBlade = file_get_contents(__DIR__.'/../Backpack/Views/AdminLTE/layouts/layout_guest.blade.stub'); |
|
284
|
+ $homeBlade = file_get_contents(__DIR__.'/../Backpack/Views/AdminLTE/home.blade.stub'); |
|
285
|
+ $loginBlade = file_get_contents(__DIR__.'/../Backpack/Views/AdminLTE/auth/login.blade.stub'); |
|
286
|
+ $registerBlade = file_get_contents(__DIR__.'/../Backpack/Views/AdminLTE/auth/register.blade.stub'); |
|
287
|
+ $resetBlade = file_get_contents(__DIR__.'/../Backpack/Views/AdminLTE/auth/passwords/reset.blade.stub'); |
|
288
|
+ $emailBlade = file_get_contents(__DIR__.'/../Backpack/Views/AdminLTE/auth/passwords/email.blade.stub'); |
|
289
|
+ $verifyEmailBlade = file_get_contents(__DIR__.'/../Backpack/Views/AdminLTE/auth/verify.blade.stub'); |
290
|
290
|
|
291
|
291
|
$update_infoBlade = file_get_contents(__DIR__ |
292
|
292
|
. '/../Backpack/Views/AdminLTE/auth/account/update_info.blade.stub'); |
|
@@ -510,10 +510,10 @@ discard block |
|
|
block discarded – undo |
510
|
510
|
{ |
511
|
511
|
$nameSmall = snake_case($this->getParsedNameInput()); |
512
|
512
|
$name = ucfirst($this->getParsedNameInput()); |
513
|
|
- $mapCallFunction = file_get_contents(__DIR__ . '/../Route/mapRoute.stub'); |
|
513
|
+ $mapCallFunction = file_get_contents(__DIR__.'/../Route/mapRoute.stub'); |
514
|
514
|
$mapCallFunctionNew = str_replace('{{$name}}', "$name", $mapCallFunction); |
515
|
515
|
$this->insert($this->getRouteServicesPath(), '$this->mapWebRoutes();', $mapCallFunctionNew, true); |
516
|
|
- $mapFunction = file_get_contents(__DIR__ . '/../Route/mapRouteFunction.stub'); |
|
516
|
+ $mapFunction = file_get_contents(__DIR__.'/../Route/mapRouteFunction.stub'); |
517
|
517
|
$mapFunctionNew = str_replace([ |
518
|
518
|
'{{$name}}', |
519
|
519
|
'{{$nameSmall}}' |
|
@@ -531,7 +531,7 @@ discard block |
|
|
block discarded – undo |
531
|
531
|
|
532
|
532
|
$routeServicesContent = file_get_contents($this->getRouteServicesPath()); |
533
|
533
|
|
534
|
|
- if (str_contains($routeServicesContent,'$this->map'.$name.'Routes();')) { |
|
534
|
+ if (str_contains($routeServicesContent, '$this->map'.$name.'Routes();')) { |
535
|
535
|
return true; |
536
|
536
|
} |
537
|
537
|
return false; |
|
@@ -551,7 +551,7 @@ discard block |
|
|
block discarded – undo |
551
|
551
|
if (!file_exists($createFolder)) { |
552
|
552
|
mkdir($createFolder); |
553
|
553
|
} |
554
|
|
- $routeFileContent = file_get_contents(__DIR__ . '/../Route/routeFile.stub'); |
|
554
|
+ $routeFileContent = file_get_contents(__DIR__.'/../Route/routeFile.stub'); |
555
|
555
|
$routeFileContentNew = str_replace([ |
556
|
556
|
'{{$name}}', |
557
|
557
|
'{{$nameSmall}}' |
|
@@ -584,8 +584,8 @@ discard block |
|
|
block discarded – undo |
584
|
584
|
if (!file_exists($requestsFolder)) { |
585
|
585
|
mkdir($requestsFolder); |
586
|
586
|
} |
587
|
|
- $accountInfoContent = file_get_contents(__DIR__ . '/../Request/AccountInfoRequest.stub'); |
588
|
|
- $changePasswordContent = file_get_contents(__DIR__ . '/../Request/ChangePasswordRequest.stub'); |
|
587
|
+ $accountInfoContent = file_get_contents(__DIR__.'/../Request/AccountInfoRequest.stub'); |
|
588
|
+ $changePasswordContent = file_get_contents(__DIR__.'/../Request/ChangePasswordRequest.stub'); |
589
|
589
|
|
590
|
590
|
$accountInfoContentNew = str_replace([ |
591
|
591
|
'{{$name}}', |
|
@@ -634,14 +634,14 @@ discard block |
|
|
block discarded – undo |
634
|
634
|
mkdir($authFolder); |
635
|
635
|
} |
636
|
636
|
|
637
|
|
- $controllerContent = file_get_contents(__DIR__ . '/../Controllers/Controller.stub'); |
638
|
|
- $homeControllerContent = file_get_contents(__DIR__ . '/../Controllers/HomeController.stub'); |
639
|
|
- $loginControllerContent = file_get_contents(__DIR__ . '/../Controllers/Auth/LoginController.stub'); |
640
|
|
- $forgotControllerContent = file_get_contents(__DIR__ . '/../Controllers/Auth/ForgotPasswordController.stub'); |
641
|
|
- $registerControllerContent = file_get_contents(__DIR__ . '/../Controllers/Auth/RegisterController.stub'); |
642
|
|
- $resetControllerContent = file_get_contents(__DIR__ . '/../Controllers/Auth/ResetPasswordController.stub'); |
643
|
|
- $myAccountControllerContent = file_get_contents(__DIR__ . '/../Controllers/Auth/MyAccountController.stub'); |
644
|
|
- $verificationControllerContent = file_get_contents(__DIR__ . '/../Controllers/Auth/VerificationController.stub'); |
|
637
|
+ $controllerContent = file_get_contents(__DIR__.'/../Controllers/Controller.stub'); |
|
638
|
+ $homeControllerContent = file_get_contents(__DIR__.'/../Controllers/HomeController.stub'); |
|
639
|
+ $loginControllerContent = file_get_contents(__DIR__.'/../Controllers/Auth/LoginController.stub'); |
|
640
|
+ $forgotControllerContent = file_get_contents(__DIR__.'/../Controllers/Auth/ForgotPasswordController.stub'); |
|
641
|
+ $registerControllerContent = file_get_contents(__DIR__.'/../Controllers/Auth/RegisterController.stub'); |
|
642
|
+ $resetControllerContent = file_get_contents(__DIR__.'/../Controllers/Auth/ResetPasswordController.stub'); |
|
643
|
+ $myAccountControllerContent = file_get_contents(__DIR__.'/../Controllers/Auth/MyAccountController.stub'); |
|
644
|
+ $verificationControllerContent = file_get_contents(__DIR__.'/../Controllers/Auth/VerificationController.stub'); |
645
|
645
|
|
646
|
646
|
$controllerFileContentNew = str_replace('{{$name}}', "$name", $controllerContent); |
647
|
647
|
|
|
@@ -745,9 +745,9 @@ discard block |
|
|
block discarded – undo |
745
|
745
|
|
746
|
746
|
$authConfigFile = $this->getConfigsFolderPath().DIRECTORY_SEPARATOR."auth.php"; |
747
|
747
|
|
748
|
|
- $guardContent = file_get_contents(__DIR__ . '/../Config/guard.stub'); |
749
|
|
- $passwordContent = file_get_contents(__DIR__ . '/../Config/password.stub'); |
750
|
|
- $providerContent = file_get_contents(__DIR__ . '/../Config/provider.stub'); |
|
748
|
+ $guardContent = file_get_contents(__DIR__.'/../Config/guard.stub'); |
|
749
|
+ $passwordContent = file_get_contents(__DIR__.'/../Config/password.stub'); |
|
750
|
+ $providerContent = file_get_contents(__DIR__.'/../Config/provider.stub'); |
751
|
751
|
|
752
|
752
|
$guardFileContentNew = str_replace([ |
753
|
753
|
'{{$nameSmall}}', |
|
@@ -788,7 +788,7 @@ discard block |
|
|
block discarded – undo |
788
|
788
|
$exceptionHandlerFile = $this->getAppFolderPath().DIRECTORY_SEPARATOR."Exceptions".DIRECTORY_SEPARATOR |
789
|
789
|
."Handler.php"; |
790
|
790
|
$exceptionHandlerFileContent = file_get_contents($exceptionHandlerFile); |
791
|
|
- $exceptionHandlerFileContentNew = file_get_contents(__DIR__ . '/../Exceptions/handlerUnauthorized.stub'); |
|
791
|
+ $exceptionHandlerFileContentNew = file_get_contents(__DIR__.'/../Exceptions/handlerUnauthorized.stub'); |
792
|
792
|
|
793
|
793
|
|
794
|
794
|
if (!str_contains($exceptionHandlerFileContent, 'MultiAuthUnAuthenticated')) { |
|
@@ -799,7 +799,7 @@ discard block |
|
|
block discarded – undo |
799
|
799
|
} |
800
|
800
|
} |
801
|
801
|
|
802
|
|
- $exceptionHandlerGuardContentNew = file_get_contents(__DIR__ . '/../Exceptions/handlerGuard.stub'); |
|
802
|
+ $exceptionHandlerGuardContentNew = file_get_contents(__DIR__.'/../Exceptions/handlerGuard.stub'); |
803
|
803
|
$exceptionHandlerGuardContentNew2 = str_replace('{{$nameSmall}}', "$nameSmall", |
804
|
804
|
$exceptionHandlerGuardContentNew); |
805
|
805
|
|
|
@@ -828,9 +828,9 @@ discard block |
|
|
block discarded – undo |
828
|
828
|
$redirectIfMiddlewareFileContent = file_get_contents($redirectIfMiddlewareFile); |
829
|
829
|
$authenticateMiddlewareFileContent = file_get_contents($redirectIfMiddlewareFile); |
830
|
830
|
|
831
|
|
- $ensureEmailIsVerifiedMiddlewareFileeContent = file_get_contents(__DIR__ . '/../Middleware/ensureEmailIsVerified.stub'); |
832
|
|
- $redirectIfMiddlewareContentNew = file_get_contents(__DIR__ . '/../Middleware/redirectIf.stub'); |
833
|
|
- $authenticateMiddlewareContentNew = file_get_contents(__DIR__ . '/../Middleware/authenticate.stub'); |
|
831
|
+ $ensureEmailIsVerifiedMiddlewareFileeContent = file_get_contents(__DIR__.'/../Middleware/ensureEmailIsVerified.stub'); |
|
832
|
+ $redirectIfMiddlewareContentNew = file_get_contents(__DIR__.'/../Middleware/redirectIf.stub'); |
|
833
|
+ $authenticateMiddlewareContentNew = file_get_contents(__DIR__.'/../Middleware/authenticate.stub'); |
834
|
834
|
|
835
|
835
|
if (!file_exists($ensureEmailIsVerifiedMiddlewareFile)) { |
836
|
836
|
file_put_contents($ensureEmailIsVerifiedMiddlewareFile, $ensureEmailIsVerifiedMiddlewareFileeContent); |
|
@@ -852,9 +852,9 @@ discard block |
|
|
block discarded – undo |
852
|
852
|
} |
853
|
853
|
} |
854
|
854
|
|
855
|
|
- $redirectIfMiddlewareGroupContentNew = file_get_contents(__DIR__ . '/../Middleware/redirectMiddleware.stub'); |
856
|
|
- $redirectIfMiddlewareGuardContentNew = file_get_contents(__DIR__ . '/../Middleware/redirectMiddlewareGuard.stub'); |
857
|
|
- $authenticateIfMiddlewareGuardContentNew = file_get_contents(__DIR__ . '/../Middleware/authenticateIf.stub'); |
|
855
|
+ $redirectIfMiddlewareGroupContentNew = file_get_contents(__DIR__.'/../Middleware/redirectMiddleware.stub'); |
|
856
|
+ $redirectIfMiddlewareGuardContentNew = file_get_contents(__DIR__.'/../Middleware/redirectMiddlewareGuard.stub'); |
|
857
|
+ $authenticateIfMiddlewareGuardContentNew = file_get_contents(__DIR__.'/../Middleware/authenticateIf.stub'); |
858
|
858
|
|
859
|
859
|
$redirectIfMiddlewareGroupContentNew2 = str_replace('{{$nameSmall}}', "$nameSmall", |
860
|
860
|
$redirectIfMiddlewareGroupContentNew); |
|
@@ -893,7 +893,7 @@ discard block |
|
|
block discarded – undo |
893
|
893
|
$this->info('### Running: '.$command); |
894
|
894
|
} |
895
|
895
|
$process = new Process($command); |
896
|
|
- $process->run(function ($type, $buffer) { |
|
896
|
+ $process->run(function($type, $buffer) { |
897
|
897
|
if (Process::ERR === $type) { |
898
|
898
|
echo '... > '.$buffer; |
899
|
899
|
} else { |
|
@@ -1046,7 +1046,7 @@ discard block |
|
|
block discarded – undo |
1046
|
1046
|
*/ |
1047
|
1047
|
public function insertIntoFile($filePath, $insertMarker, $text, $after = true) { |
1048
|
1048
|
$contents = file_get_contents($filePath); |
1049
|
|
- $new_contents = preg_replace($insertMarker,($after) ? '$0' . $text : $text . '$0', $contents); |
|
1049
|
+ $new_contents = preg_replace($insertMarker, ($after) ? '$0'.$text : $text.'$0', $contents); |
1050
|
1050
|
return file_put_contents($filePath, $new_contents); |
1051
|
1051
|
} |
1052
|
1052
|
|
|
@@ -1063,7 +1063,7 @@ discard block |
|
|
block discarded – undo |
1063
|
1063
|
public function insert($filePath, $keyword, $body, $after = true) { |
1064
|
1064
|
|
1065
|
1065
|
$contents = file_get_contents($filePath); |
1066
|
|
- $new_contents = substr_replace($contents, PHP_EOL . $body, |
|
1066
|
+ $new_contents = substr_replace($contents, PHP_EOL.$body, |
1067
|
1067
|
($after) ? strpos($contents, $keyword) + strlen($keyword) : strpos($contents, $keyword) |
1068
|
1068
|
, 0); |
1069
|
1069
|
return file_put_contents($filePath, $new_contents); |