@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $admin_theme = 'adminlte'; |
78 | 78 | } |
79 | 79 | |
80 | - if (file_exists(__DIR__ . '/../Backpack/Views/'.$admin_theme)) { |
|
80 | + if (file_exists(__DIR__.'/../Backpack/Views/'.$admin_theme)) { |
|
81 | 81 | if ($this->isAlreadySetup() == false) { |
82 | 82 | |
83 | 83 | $this->line(" installing migrations..."); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | |
174 | 174 | |
175 | 175 | |
176 | - $modelTableContent = file_get_contents(__DIR__ . '/../Migration/modelTable.stub'); |
|
176 | + $modelTableContent = file_get_contents(__DIR__.'/../Migration/modelTable.stub'); |
|
177 | 177 | $modelTableContentNew = str_replace([ |
178 | 178 | '{{$namePlural}}', |
179 | 179 | '{{$nameSmallPlural}}', |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | ], $modelTableContent); |
184 | 184 | |
185 | 185 | |
186 | - $modelResetPasswordTableContent = file_get_contents(__DIR__ . '/../Migration/passwordResetsTable.stub'); |
|
186 | + $modelResetPasswordTableContent = file_get_contents(__DIR__.'/../Migration/passwordResetsTable.stub'); |
|
187 | 187 | $modelResetPasswordTableContentNew = str_replace([ |
188 | 188 | '{{$namePlural}}', |
189 | 189 | '{{$nameSmallPlural}}', |
@@ -193,12 +193,12 @@ discard block |
||
193 | 193 | ], $modelResetPasswordTableContent); |
194 | 194 | |
195 | 195 | |
196 | - $migrationName = date('Y_m_d_His') . '_'.'create_' . str_plural(snake_case($name)) .'_table.php'; |
|
196 | + $migrationName = date('Y_m_d_His').'_'.'create_'.str_plural(snake_case($name)).'_table.php'; |
|
197 | 197 | $migrationModelPath = $this->getMigrationPath().DIRECTORY_SEPARATOR.$migrationName; |
198 | 198 | file_put_contents($migrationModelPath, $modelTableContentNew); |
199 | 199 | |
200 | - $migrationResetName = date('Y_m_d_His') . '_' |
|
201 | - .'create_' . str_plural(snake_case($name)) |
|
200 | + $migrationResetName = date('Y_m_d_His').'_' |
|
201 | + .'create_'.str_plural(snake_case($name)) |
|
202 | 202 | .'_password_resets_table.php'; |
203 | 203 | $migrationResetModelPath = $this->getMigrationPath().DIRECTORY_SEPARATOR.$migrationResetName; |
204 | 204 | file_put_contents($migrationResetModelPath, $modelResetPasswordTableContentNew); |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | array_push($newChanges, $nameSmallPlural); |
233 | 233 | array_push($newChanges, $nameSmall); |
234 | 234 | |
235 | - $modelContent = file_get_contents(__DIR__ . '/../Backpack/Model/model.stub'); |
|
235 | + $modelContent = file_get_contents(__DIR__.'/../Backpack/Model/model.stub'); |
|
236 | 236 | $modelContentNew = str_replace($arrayToChange, $newChanges, $modelContent); |
237 | 237 | |
238 | 238 | $createFolder = $this->getAppFolderPath().DIRECTORY_SEPARATOR."Models"; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | |
246 | 246 | |
247 | 247 | |
248 | - $resetNotificationContent = file_get_contents(__DIR__ . '/../Notification/resetPasswordNotification.stub'); |
|
248 | + $resetNotificationContent = file_get_contents(__DIR__.'/../Notification/resetPasswordNotification.stub'); |
|
249 | 249 | $resetNotificationContentNew = str_replace([ |
250 | 250 | '{{$name}}', |
251 | 251 | '{{$nameSmall}}', |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $nameSmall |
255 | 255 | ], $resetNotificationContent); |
256 | 256 | |
257 | - $verifyEmailContent = file_get_contents(__DIR__ . '/../Notification/verifyEmailNotification.stub'); |
|
257 | + $verifyEmailContent = file_get_contents(__DIR__.'/../Notification/verifyEmailNotification.stub'); |
|
258 | 258 | $verifyEmailContentNew = str_replace([ |
259 | 259 | '{{$name}}', |
260 | 260 | '{{$nameSmall}}', |
@@ -286,25 +286,25 @@ discard block |
||
286 | 286 | */ |
287 | 287 | public function installView($theme_name = 'adminlte') |
288 | 288 | { |
289 | - if (file_exists(__DIR__ . '/../Backpack/Views/'.$theme_name)) { |
|
289 | + if (file_exists(__DIR__.'/../Backpack/Views/'.$theme_name)) { |
|
290 | 290 | $nameSmall = snake_case($this->getParsedNameInput()); |
291 | 291 | $name = ucfirst($this->getParsedNameInput()); |
292 | 292 | |
293 | 293 | // layouts |
294 | - $appBlade = file_get_contents(__DIR__ . '/../Backpack/Views/'.$theme_name.'/layouts/layout.blade.stub'); |
|
295 | - $appGuestBlade = file_get_contents(__DIR__ . '/../Backpack/Views/'.$theme_name.'/layouts/layout_guest.blade.stub'); |
|
294 | + $appBlade = file_get_contents(__DIR__.'/../Backpack/Views/'.$theme_name.'/layouts/layout.blade.stub'); |
|
295 | + $appGuestBlade = file_get_contents(__DIR__.'/../Backpack/Views/'.$theme_name.'/layouts/layout_guest.blade.stub'); |
|
296 | 296 | |
297 | 297 | // home |
298 | - $homeBlade = file_get_contents(__DIR__ . '/../Backpack/Views/'.$theme_name.'/home.blade.stub'); |
|
298 | + $homeBlade = file_get_contents(__DIR__.'/../Backpack/Views/'.$theme_name.'/home.blade.stub'); |
|
299 | 299 | |
300 | 300 | // auth |
301 | - $loginBlade = file_get_contents(__DIR__ . '/../Backpack/Views/'.$theme_name.'/auth/login.blade.stub'); |
|
302 | - $registerBlade = file_get_contents(__DIR__ . '/../Backpack/Views/'.$theme_name.'/auth/register.blade.stub'); |
|
303 | - $verifyEmailBlade = file_get_contents(__DIR__ . '/../Backpack/Views/'.$theme_name.'/auth/verify.blade.stub'); |
|
301 | + $loginBlade = file_get_contents(__DIR__.'/../Backpack/Views/'.$theme_name.'/auth/login.blade.stub'); |
|
302 | + $registerBlade = file_get_contents(__DIR__.'/../Backpack/Views/'.$theme_name.'/auth/register.blade.stub'); |
|
303 | + $verifyEmailBlade = file_get_contents(__DIR__.'/../Backpack/Views/'.$theme_name.'/auth/verify.blade.stub'); |
|
304 | 304 | |
305 | 305 | // auth/passwords |
306 | - $resetBlade = file_get_contents(__DIR__ . '/../Backpack/Views/'.$theme_name.'/auth/passwords/reset.blade.stub'); |
|
307 | - $emailBlade = file_get_contents(__DIR__ . '/../Backpack/Views/'.$theme_name.'/auth/passwords/email.blade.stub'); |
|
306 | + $resetBlade = file_get_contents(__DIR__.'/../Backpack/Views/'.$theme_name.'/auth/passwords/reset.blade.stub'); |
|
307 | + $emailBlade = file_get_contents(__DIR__.'/../Backpack/Views/'.$theme_name.'/auth/passwords/email.blade.stub'); |
|
308 | 308 | |
309 | 309 | // auth/account |
310 | 310 | $update_infoBlade = file_get_contents(__DIR__ |
@@ -561,10 +561,10 @@ discard block |
||
561 | 561 | { |
562 | 562 | $nameSmall = snake_case($this->getParsedNameInput()); |
563 | 563 | $name = ucfirst($this->getParsedNameInput()); |
564 | - $mapCallFunction = file_get_contents(__DIR__ . '/../Route/mapRoute.stub'); |
|
564 | + $mapCallFunction = file_get_contents(__DIR__.'/../Route/mapRoute.stub'); |
|
565 | 565 | $mapCallFunctionNew = str_replace('{{$name}}', "$name", $mapCallFunction); |
566 | 566 | $this->insert($this->getRouteServicesPath(), '$this->mapWebRoutes();', $mapCallFunctionNew, true); |
567 | - $mapFunction = file_get_contents(__DIR__ . '/../Route/mapRouteFunction.stub'); |
|
567 | + $mapFunction = file_get_contents(__DIR__.'/../Route/mapRouteFunction.stub'); |
|
568 | 568 | $mapFunctionNew = str_replace([ |
569 | 569 | '{{$name}}', |
570 | 570 | '{{$nameSmall}}' |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | |
583 | 583 | $routeServicesContent = file_get_contents($this->getRouteServicesPath()); |
584 | 584 | |
585 | - if (str_contains($routeServicesContent,'$this->map'.$name.'Routes();')) { |
|
585 | + if (str_contains($routeServicesContent, '$this->map'.$name.'Routes();')) { |
|
586 | 586 | return true; |
587 | 587 | } |
588 | 588 | return false; |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | if (!file_exists($createFolder)) { |
603 | 603 | mkdir($createFolder); |
604 | 604 | } |
605 | - $routeFileContent = file_get_contents(__DIR__ . '/../Route/routeFile.stub'); |
|
605 | + $routeFileContent = file_get_contents(__DIR__.'/../Route/routeFile.stub'); |
|
606 | 606 | $routeFileContentNew = str_replace([ |
607 | 607 | '{{$name}}', |
608 | 608 | '{{$nameSmall}}' |
@@ -635,8 +635,8 @@ discard block |
||
635 | 635 | if (!file_exists($requestsFolder)) { |
636 | 636 | mkdir($requestsFolder); |
637 | 637 | } |
638 | - $accountInfoContent = file_get_contents(__DIR__ . '/../Request/AccountInfoRequest.stub'); |
|
639 | - $changePasswordContent = file_get_contents(__DIR__ . '/../Request/ChangePasswordRequest.stub'); |
|
638 | + $accountInfoContent = file_get_contents(__DIR__.'/../Request/AccountInfoRequest.stub'); |
|
639 | + $changePasswordContent = file_get_contents(__DIR__.'/../Request/ChangePasswordRequest.stub'); |
|
640 | 640 | |
641 | 641 | $accountInfoContentNew = str_replace([ |
642 | 642 | '{{$name}}', |
@@ -685,14 +685,14 @@ discard block |
||
685 | 685 | mkdir($authFolder); |
686 | 686 | } |
687 | 687 | |
688 | - $controllerContent = file_get_contents(__DIR__ . '/../Controllers/Controller.stub'); |
|
689 | - $homeControllerContent = file_get_contents(__DIR__ . '/../Controllers/HomeController.stub'); |
|
690 | - $loginControllerContent = file_get_contents(__DIR__ . '/../Controllers/Auth/LoginController.stub'); |
|
691 | - $forgotControllerContent = file_get_contents(__DIR__ . '/../Controllers/Auth/ForgotPasswordController.stub'); |
|
692 | - $registerControllerContent = file_get_contents(__DIR__ . '/../Controllers/Auth/RegisterController.stub'); |
|
693 | - $resetControllerContent = file_get_contents(__DIR__ . '/../Controllers/Auth/ResetPasswordController.stub'); |
|
694 | - $myAccountControllerContent = file_get_contents(__DIR__ . '/../Controllers/Auth/MyAccountController.stub'); |
|
695 | - $verificationControllerContent = file_get_contents(__DIR__ . '/../Controllers/Auth/VerificationController.stub'); |
|
688 | + $controllerContent = file_get_contents(__DIR__.'/../Controllers/Controller.stub'); |
|
689 | + $homeControllerContent = file_get_contents(__DIR__.'/../Controllers/HomeController.stub'); |
|
690 | + $loginControllerContent = file_get_contents(__DIR__.'/../Controllers/Auth/LoginController.stub'); |
|
691 | + $forgotControllerContent = file_get_contents(__DIR__.'/../Controllers/Auth/ForgotPasswordController.stub'); |
|
692 | + $registerControllerContent = file_get_contents(__DIR__.'/../Controllers/Auth/RegisterController.stub'); |
|
693 | + $resetControllerContent = file_get_contents(__DIR__.'/../Controllers/Auth/ResetPasswordController.stub'); |
|
694 | + $myAccountControllerContent = file_get_contents(__DIR__.'/../Controllers/Auth/MyAccountController.stub'); |
|
695 | + $verificationControllerContent = file_get_contents(__DIR__.'/../Controllers/Auth/VerificationController.stub'); |
|
696 | 696 | |
697 | 697 | $controllerFileContentNew = str_replace('{{$name}}', "$name", $controllerContent); |
698 | 698 | |
@@ -796,9 +796,9 @@ discard block |
||
796 | 796 | |
797 | 797 | $authConfigFile = $this->getConfigsFolderPath().DIRECTORY_SEPARATOR."auth.php"; |
798 | 798 | |
799 | - $guardContent = file_get_contents(__DIR__ . '/../Config/guard.stub'); |
|
800 | - $passwordContent = file_get_contents(__DIR__ . '/../Config/password.stub'); |
|
801 | - $providerContent = file_get_contents(__DIR__ . '/../Config/provider.stub'); |
|
799 | + $guardContent = file_get_contents(__DIR__.'/../Config/guard.stub'); |
|
800 | + $passwordContent = file_get_contents(__DIR__.'/../Config/password.stub'); |
|
801 | + $providerContent = file_get_contents(__DIR__.'/../Config/provider.stub'); |
|
802 | 802 | |
803 | 803 | $guardFileContentNew = str_replace([ |
804 | 804 | '{{$nameSmall}}', |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | $exceptionHandlerFile = $this->getAppFolderPath().DIRECTORY_SEPARATOR."Exceptions".DIRECTORY_SEPARATOR |
840 | 840 | ."Handler.php"; |
841 | 841 | $exceptionHandlerFileContent = file_get_contents($exceptionHandlerFile); |
842 | - $exceptionHandlerFileContentNew = file_get_contents(__DIR__ . '/../Exceptions/handlerUnauthorized.stub'); |
|
842 | + $exceptionHandlerFileContentNew = file_get_contents(__DIR__.'/../Exceptions/handlerUnauthorized.stub'); |
|
843 | 843 | |
844 | 844 | |
845 | 845 | if (!str_contains($exceptionHandlerFileContent, 'MultiAuthUnAuthenticated')) { |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | } |
851 | 851 | } |
852 | 852 | |
853 | - $exceptionHandlerGuardContentNew = file_get_contents(__DIR__ . '/../Exceptions/handlerGuard.stub'); |
|
853 | + $exceptionHandlerGuardContentNew = file_get_contents(__DIR__.'/../Exceptions/handlerGuard.stub'); |
|
854 | 854 | $exceptionHandlerGuardContentNew2 = str_replace('{{$nameSmall}}', "$nameSmall", |
855 | 855 | $exceptionHandlerGuardContentNew); |
856 | 856 | |
@@ -879,9 +879,9 @@ discard block |
||
879 | 879 | $redirectIfMiddlewareFileContent = file_get_contents($redirectIfMiddlewareFile); |
880 | 880 | $authenticateMiddlewareFileContent = file_get_contents($redirectIfMiddlewareFile); |
881 | 881 | |
882 | - $ensureEmailIsVerifiedMiddlewareFileeContent = file_get_contents(__DIR__ . '/../Middleware/ensureEmailIsVerified.stub'); |
|
883 | - $redirectIfMiddlewareContentNew = file_get_contents(__DIR__ . '/../Middleware/redirectIf.stub'); |
|
884 | - $authenticateMiddlewareContentNew = file_get_contents(__DIR__ . '/../Middleware/authenticate.stub'); |
|
882 | + $ensureEmailIsVerifiedMiddlewareFileeContent = file_get_contents(__DIR__.'/../Middleware/ensureEmailIsVerified.stub'); |
|
883 | + $redirectIfMiddlewareContentNew = file_get_contents(__DIR__.'/../Middleware/redirectIf.stub'); |
|
884 | + $authenticateMiddlewareContentNew = file_get_contents(__DIR__.'/../Middleware/authenticate.stub'); |
|
885 | 885 | |
886 | 886 | if (!file_exists($ensureEmailIsVerifiedMiddlewareFile)) { |
887 | 887 | file_put_contents($ensureEmailIsVerifiedMiddlewareFile, $ensureEmailIsVerifiedMiddlewareFileeContent); |
@@ -903,9 +903,9 @@ discard block |
||
903 | 903 | } |
904 | 904 | } |
905 | 905 | |
906 | - $redirectIfMiddlewareGroupContentNew = file_get_contents(__DIR__ . '/../Middleware/redirectMiddleware.stub'); |
|
907 | - $redirectIfMiddlewareGuardContentNew = file_get_contents(__DIR__ . '/../Middleware/redirectMiddlewareGuard.stub'); |
|
908 | - $authenticateIfMiddlewareGuardContentNew = file_get_contents(__DIR__ . '/../Middleware/authenticateIf.stub'); |
|
906 | + $redirectIfMiddlewareGroupContentNew = file_get_contents(__DIR__.'/../Middleware/redirectMiddleware.stub'); |
|
907 | + $redirectIfMiddlewareGuardContentNew = file_get_contents(__DIR__.'/../Middleware/redirectMiddlewareGuard.stub'); |
|
908 | + $authenticateIfMiddlewareGuardContentNew = file_get_contents(__DIR__.'/../Middleware/authenticateIf.stub'); |
|
909 | 909 | |
910 | 910 | $redirectIfMiddlewareGroupContentNew2 = str_replace('{{$nameSmall}}', "$nameSmall", |
911 | 911 | $redirectIfMiddlewareGroupContentNew); |
@@ -944,7 +944,7 @@ discard block |
||
944 | 944 | $this->info('### Running: '.$command); |
945 | 945 | } |
946 | 946 | $process = new Process($command); |
947 | - $process->run(function ($type, $buffer) { |
|
947 | + $process->run(function($type, $buffer) { |
|
948 | 948 | if (Process::ERR === $type) { |
949 | 949 | echo '... > '.$buffer; |
950 | 950 | } else { |
@@ -1097,7 +1097,7 @@ discard block |
||
1097 | 1097 | */ |
1098 | 1098 | public function insertIntoFile($filePath, $insertMarker, $text, $after = true) { |
1099 | 1099 | $contents = file_get_contents($filePath); |
1100 | - $new_contents = preg_replace($insertMarker,($after) ? '$0' . $text : $text . '$0', $contents); |
|
1100 | + $new_contents = preg_replace($insertMarker, ($after) ? '$0'.$text : $text.'$0', $contents); |
|
1101 | 1101 | return file_put_contents($filePath, $new_contents); |
1102 | 1102 | } |
1103 | 1103 | |
@@ -1114,7 +1114,7 @@ discard block |
||
1114 | 1114 | public function insert($filePath, $keyword, $body, $after = true) { |
1115 | 1115 | |
1116 | 1116 | $contents = file_get_contents($filePath); |
1117 | - $new_contents = substr_replace($contents, PHP_EOL . $body, |
|
1117 | + $new_contents = substr_replace($contents, PHP_EOL.$body, |
|
1118 | 1118 | ($after) ? strpos($contents, $keyword) + strlen($keyword) : strpos($contents, $keyword) |
1119 | 1119 | , 0); |
1120 | 1120 | return file_put_contents($filePath, $new_contents); |