From 9b691ee2a4a1523ab1077b6f803ef6d8d35aa52c Mon Sep 17 00:00:00 2001 From: bangnokia Date: Wed, 24 Mar 2021 00:05:42 +0700 Subject: [PATCH] fix compatible with laravel sanctum --- src/ResponseServiceProvider.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ResponseServiceProvider.php b/src/ResponseServiceProvider.php index e6c3caa..15018c4 100644 --- a/src/ResponseServiceProvider.php +++ b/src/ResponseServiceProvider.php @@ -2,8 +2,9 @@ namespace BangNokia\ServeLiveReload; -use BangNokia\ServeLiveReload\Middleware\InjectScriptsMiddleware; +use Illuminate\Contracts\Http\Kernel; use Illuminate\Support\ServiceProvider; +use BangNokia\ServeLiveReload\Middleware\InjectScriptsMiddleware; class ResponseServiceProvider extends ServiceProvider { @@ -11,6 +12,7 @@ public function boot() { $this->loadViewsFrom(__DIR__.'/../views/', 'serve_livereload'); - $this->app['router']->pushMiddlewareToGroup('web', InjectScriptsMiddleware::class); + $this->app->make(Kernel::class) + ->prependMiddlewareToGroup('web', InjectScriptsMiddleware::class); } }