From 73c4fd5fbf14923e109bc4eb53eb20d644befcf1 Mon Sep 17 00:00:00 2001 From: Tony Lea Date: Tue, 12 Mar 2024 15:32:02 -0400 Subject: [PATCH] Update GenesisPreset.php Updating the middleware that's added to be added to the bootstrap/app.php file instead of the kernel. --- src/GenesisPreset.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GenesisPreset.php b/src/GenesisPreset.php index 79f9bff..4dd6a4a 100644 --- a/src/GenesisPreset.php +++ b/src/GenesisPreset.php @@ -33,10 +33,10 @@ public static function install($stubDirectoryType = 'functional') $filesystem->copyDirectory(__DIR__ . "/../stubs/{$stubDirectory}", base_path()); - static::updateFile(base_path('app/Http/Kernel.php'), function ($file) { + static::updateFile(base_path('bootstrap/app.php'), function ($file) { return str_replace( - "'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,", - "'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,\n\t\t'redirect-to-dashboard' => \App\Http\Middleware\RedirectToDashboard::class,", + "->withMiddleware(function (Middleware \$middleware) {", + "->withMiddleware(function (Middleware \$middleware) {\n\t\t\$middleware->alias([\n\t\t\t'redirect-to-dashboard' => \App\Http\Middleware\RedirectToDashboard::class\n\t\t]);", $file ); });