Skip to content
This repository was archived by the owner on Oct 20, 2025. It is now read-only.

Commit 80c920e

Browse files
authored
Fix for L10 installation (#318)
1 parent c381332 commit 80c920e

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/Commands/InstallsSpladeExceptionHandler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ protected function installExceptionHandler()
1717

1818
$exceptionHandler = file_get_contents(app_path('Exceptions/Handler.php'));
1919

20-
$search = 'public function register()' . $eol . ' {';
20+
$search = version_compare(app()->version(), '10.0', '>=')
21+
? 'public function register(): void' . $eol . ' {'
22+
: 'public function register()' . $eol . ' {';
2123

2224
$registerMethodAfter = Str::after($exceptionHandler, $search);
2325

src/Commands/InstallsSpladeRouteMiddleware.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ protected function installRouteMiddleware()
1515
{
1616
$httpKernel = file_get_contents(app_path('Http/Kernel.php'));
1717

18-
$search = 'protected $routeMiddleware = [' . SpladeInstallCommand::eol();
18+
$eol = SpladeInstallCommand::eol();
19+
20+
$search = version_compare(app()->version(), '10.0', '>=')
21+
? 'protected $middlewareAliases = [' . $eol
22+
: 'protected $routeMiddleware = [' . $eol;
1923

2024
$routeMiddlewareAfter = Str::after($httpKernel, $search);
2125

@@ -29,7 +33,7 @@ protected function installRouteMiddleware()
2933
app_path('Http/Kernel.php'),
3034
str_replace(
3135
$routeMiddlewareAfter,
32-
' ' . $routeMiddleware . ',' . SpladeInstallCommand::eol() . $routeMiddlewareAfter,
36+
' ' . $routeMiddleware . ',' . $eol . $routeMiddlewareAfter,
3337
$httpKernel
3438
)
3539
);

0 commit comments

Comments
 (0)