Locale object not available after change routes
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Locale object not available after change routes
I have error "Locale object not available " when I change my routes in config/shop.php.
New entry is:
'routes' => [
'admin' => ['domain' => '{site}', 'prefix' => 'admin', 'middleware' => ['web']],
'jqadm' => ['domain' => '{site}', 'prefix' => 'admin/jqadm', 'middleware' => ['web', 'auth']],
'jsonadm' => ['domain' => '{site}', 'prefix' => 'admin/jsonadm', 'middleware' => ['web', 'auth']],
'jsonapi' => ['domain' => '{site}', 'prefix' => 'jsonapi', 'middleware' => ['web', 'api']],
'account' => ['domain' => '{site}', 'prefix' => 'profile', 'middleware' => ['web', 'auth']],
'default' => ['domain' => '{site}', 'prefix' => 'shop', 'middleware' => ['web']],
'update' => ['domain' => '{site}'],
]
Error occured in:
\vendor\aimeos\aimeos-core\lib\mshoplib\src\MShop\Context\Item\Standard.php:425
New entry is:
'routes' => [
'admin' => ['domain' => '{site}', 'prefix' => 'admin', 'middleware' => ['web']],
'jqadm' => ['domain' => '{site}', 'prefix' => 'admin/jqadm', 'middleware' => ['web', 'auth']],
'jsonadm' => ['domain' => '{site}', 'prefix' => 'admin/jsonadm', 'middleware' => ['web', 'auth']],
'jsonapi' => ['domain' => '{site}', 'prefix' => 'jsonapi', 'middleware' => ['web', 'api']],
'account' => ['domain' => '{site}', 'prefix' => 'profile', 'middleware' => ['web', 'auth']],
'default' => ['domain' => '{site}', 'prefix' => 'shop', 'middleware' => ['web']],
'update' => ['domain' => '{site}'],
]
Error occured in:
\vendor\aimeos\aimeos-core\lib\mshoplib\src\MShop\Context\Item\Standard.php:425
Re: Locale object not available after change routes
I create custom page and try using Aimeos context object in my custom controller and I receive this error. And I change my site code from "default" to "test.localhost" Bellow line causes error:
app('aimeos.context')->get()
app('aimeos.context')->get()
Re: Locale object not available after change routes
The site code ("default" by default) must be changed to the domain in the URL (e.g. "test.localhost"). Furthermore, you have to adapt this setting in your ./config/shop.php to that domain too:
https://github.com/aimeos/aimeos-larave ... p.php#L123
https://github.com/aimeos/aimeos-larave ... p.php#L123
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Locale object not available after change routes
But I have two sites. First site has site code = test.localhost and second site has site code = test2.localhost.
Each domain has this error.
Each domain has this error.
Re: Locale object not available after change routes
When using your custom controller, you also have a custom route, don't you?
In that case, make sure that the domain is also used as "{site}" parameter there.
In that case, make sure that the domain is also used as "{site}" parameter there.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star