Move ApplicationSession::class earlier, we are dependant on config('server') existing when loading user details

This commit is contained in:
Deon George 2024-01-20 13:25:54 +11:00
parent c1ba6df90d
commit acc6598da1
2 changed files with 3 additions and 3 deletions

View File

@ -35,13 +35,13 @@ class Kernel extends HttpKernel
\App\Http\Middleware\EncryptCookies::class, \App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class, \Illuminate\Session\Middleware\StartSession::class,
ApplicationSession::class,
SwapinAuthUser::class, SwapinAuthUser::class,
\Illuminate\Session\Middleware\AuthenticateSession::class, \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class, \App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class, \Illuminate\Routing\Middleware\SubstituteBindings::class,
\Laravel\Passport\Http\Middleware\CreateFreshApiToken::class, \Laravel\Passport\Http\Middleware\CreateFreshApiToken::class,
ApplicationSession::class,
CheckUpdate::class, CheckUpdate::class,
], ],

View File

@ -20,10 +20,10 @@ class ApplicationSession
*/ */
public function handle($request,Closure $next) public function handle($request,Closure $next)
{ {
view()->share('user', auth()->user() ?: new User);
\Config::set('server',new Server); \Config::set('server',new Server);
view()->share('user', auth()->user() ?: new User);
return $next($request); return $next($request);
} }
} }