Remove AfterSessionBooted middleware
This commit is contained in:
parent
23a9f018ca
commit
09b9959bc8
|
|
@ -30,7 +30,6 @@ class Kernel extends HttpKernel
|
||||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||||
\Illuminate\Session\Middleware\StartSession::class,
|
\Illuminate\Session\Middleware\StartSession::class,
|
||||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||||
\App\Http\Middleware\AfterSessionBooted::class,
|
|
||||||
\App\Http\Middleware\DetectLanguagePrefer::class,
|
\App\Http\Middleware\DetectLanguagePrefer::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Middleware;
|
|
||||||
|
|
||||||
use Closure;
|
|
||||||
|
|
||||||
class AfterSessionBooted
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Jobs should be done after session booted.
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
public static $jobs;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Handle an incoming request.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param \Closure $next
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function handle($request, Closure $next)
|
|
||||||
{
|
|
||||||
foreach (static::$jobs as $job) {
|
|
||||||
if (is_callable($job)) {
|
|
||||||
app()->call($job);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $next($request);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -29,8 +29,6 @@ class DetectLanguagePrefer
|
||||||
}
|
}
|
||||||
|
|
||||||
app()->setLocale($locale);
|
app()->setLocale($locale);
|
||||||
AfterSessionBooted::$jobs[] = function () {
|
session(['locale' => config('app.locale')]);
|
||||||
session(['locale' => config('app.locale')]);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user