Laravel doesn't give the correct locale in Provider #46706
Unanswered
mstfkhazaal
asked this question in
Q&A
Replies: 1 comment
-
Service providers come before sessions. If you need to do something in a request, do so in a Middleware. What exactly are you trying to do that you need locale for in a service provider? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version
10.6.1
PHP Version
8.2.4
Database Driver & Version
Mysql Ver 8.0.32-0ubuntu0.22.04.2 for Linux on x86_64 ((Ubuntu))
Description
Laravel doesn't give the correct locale in Any Provider and session is empty
Steps To Reproduce
I use app() -> getLocale()
When the site is fully loaded it gives me the correct language from session
but in Povider i get empty session and get the default language of my website
Beta Was this translation helpful? Give feedback.
All reactions