Access Managers in Laravel Controller
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!
-
- Posts: 40
- Joined: 02 Dec 2021, 17:18
Access Managers in Laravel Controller
I need to access those Managers which handles 'products' into my Custom Laravel Controller ; How can I fetch list of products from database ;
this chunk is not working inside of laravel controller;
Help me access products list within my Laravel Controller
TIA
Code: Select all
$manager = \Aimeos\MShop::create( $this->getContext(), 'product' );
Help me access products list within my Laravel Controller
TIA

Re: Access Managers in Laravel Controller
Use this code to get the context in Laravel:
Please read the documentation too:
https://aimeos.org/docs/latest/laravel/ ... os-objects
Code: Select all
$context = app( 'aimeos.context' )->get();
https://aimeos.org/docs/latest/laravel/ ... os-objects
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

-
- Posts: 40
- Joined: 02 Dec 2021, 17:18
Re: Access Managers in Laravel Controller
How Can I fetch active siteid from session in Laravel Controller to utilize it to fetch other related data from database;
TIA
TIA
Re: Access Managers in Laravel Controller
If you use the Aimeos frontend controllers or managers, the current site ID is automatically used.
Otherwise, you can get the site ID that way:
Otherwise, you can get the site ID that way:
Code: Select all
$context->locale()->getSiteId()
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
