Open hh0210 opened 4 years ago
You can try to do these things:
Find auth.excepts in config/admin.php And add 'locale' . Looks like this
'excepts' => [
'auth/login',
'auth/logout',
'locale',
],
Open MultiLanguageMiddleware.php and add the code below in the first line of handle() function
config(['admin.auth.excepts' => ['auth/login','locale']]);
Same as PullRequest#12
If it still doesn't work, Please check whether the current URL follows the https protocol If yes, Find https in config/admin.php . Make sure its value is true .
Hi, @hh0210 . I had this problem today too. Sorry my English is not very good, but I hope to answer your question. Maybe you can try this.
add this code to in side, \KevinSoft\MultiLanguage\Middlewares\MultiLanguageMiddleware::class
.
Look like this
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
// add this line.
\KevinSoft\MultiLanguage\Middlewares\MultiLanguageMiddleware::class
],
'api' => [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
I am not sure if this method is suitable for your project, but I can run it successfully !!!
@kai890707 this fixed the translation for me, thanks. :)
Code i had run
edited config/admin.php with this 2 parts
'auth' => [ 'excepts' => [ 'auth/login', 'auth/logout', 'locale', '_handleaction', ], ],