Some checks failed
Admin | Playwright Tests / Admin | Playwright Tests | Shard 1 Of 6 (push) Failing after 37s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 2 Of 6 (push) Failing after 7s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 4 Of 6 (push) Failing after 7s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 6 Of 6 (push) Failing after 6s
Linting Tests / PHP 8.3 test on ubuntu-latest (push) Failing after 5s
CI / PHP 8.3 test on ubuntu-latest (push) Failing after 6s
Skills Consistency / validate-skills (push) Successful in 10s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 3 Of 6 (push) Failing after 7s
Admin | Playwright Tests / Admin | Playwright Tests | Shard 5 Of 6 (push) Failing after 6s
41 lines
744 B
PHP
41 lines
744 B
PHP
<?php
|
|
|
|
namespace Webkul\Admin\Http\Middleware;
|
|
|
|
use Closure;
|
|
use Illuminate\Foundation\Application;
|
|
use Illuminate\Http\Request;
|
|
|
|
class Locale
|
|
{
|
|
/**
|
|
* The middleware instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct(
|
|
Application $app,
|
|
Request $request
|
|
) {
|
|
$this->app = $app;
|
|
|
|
$this->request = $request;
|
|
}
|
|
|
|
/**
|
|
* Handle an incoming request.
|
|
*
|
|
* @param Request $request
|
|
* @return mixed
|
|
*/
|
|
public function handle($request, Closure $next)
|
|
{
|
|
app()->setLocale(
|
|
core()->getConfigData('general.general.locale_settings.locale')
|
|
?: app()->getLocale()
|
|
);
|
|
|
|
return $next($request);
|
|
}
|
|
}
|