You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gets the application from when laravel octane is instantiated, so even if the language is changed, it will continue to return the default language, causing carbon to not update.
How to solve the problem?
Change the $this->app inside updateLocale
Responding to a thread on laravel/octane (laravel/octane#551 (comment)), I discovered a bug in this package.
From what I indicate in the title, this package is not supported when using Laravel Octane.
What is the problem?
When updating the language of the application using
app()->setLocale('xx')
, the language in carbon is not updatedWhere does the problem originate?
In:
Carbon/src/Carbon/Laravel/ServiceProvider.php
Line 47 in a900060
Gets the application from when laravel octane is instantiated, so even if the language is changed, it will continue to return the default language, causing carbon to not update.
How to solve the problem?
Change the
$this->app
insideupdateLocale
Carbon/src/Carbon/Laravel/ServiceProvider.php
Line 45 in a900060
to
Illuminate\Container\Container::getInstance()
This solution should work whether laravel octane is used or not.
The text was updated successfully, but these errors were encountered: