Run Aimeos jobs 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!
Run Aimeos jobs in Laravel controller
Hello! I`m writing custom product import script for my project.
It helps the shop admin to choose which columns from Excel file have to be imported.
After admin finishes, the script saves the final CSV file to my local storage (public/csv/products directory).
After that i have to run in console to import products.
What i try to achieve is running in my controller, not in console.
Laravel allows me to run console commands in controllers using Artisan::call() function, so i tried next:
and
Unfortunately, none of those options didn't give any result.
Is there any way to run Aimeos jobs within Laravel controller?
System: Aimeos 2019.07, Laravel 5.8, Fedora 30, PHP 7.3
Thank you for your time and have a happy upcoming holidays!
It helps the shop admin to choose which columns from Excel file have to be imported.
After admin finishes, the script saves the final CSV file to my local storage (public/csv/products directory).
After that i have to run
Code: Select all
php artisan aimeos:jobs product/import/csv myshop
What i try to achieve is running
Code: Select all
php artisan aimeos:jobs product/import/csv myshop
Laravel allows me to run console commands in controllers using Artisan::call() function, so i tried next:
Code: Select all
Artisan::call('aimeos:jobs', ['jobs' => 'product/import/csv', 'site' => 'smartshop']);
Code: Select all
Artisan::call('aimeos:jobs product/import/csv smartshop');
Is there any way to run Aimeos jobs within Laravel controller?
System: Aimeos 2019.07, Laravel 5.8, Fedora 30, PHP 7.3
Thank you for your time and have a happy upcoming holidays!
Re: Run Aimeos jobs in Laravel controller
If nothing works, you can also implement the code from the aimeos:jobs command directly:
https://github.com/aimeos/aimeos-larave ... nd.php#L47
https://github.com/aimeos/aimeos-larave ... nd.php#L47
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: Run Aimeos jobs in Laravel controller
Hello, I have created a job controller to importing products from xlsx file.
The controller working correctly on console command
php artisan aimeos:jobs "product/import/xlsx" "default"
php artisan aimeos:jobs "product/export/xlsx" "default"
I want to implement this job controler like aimeos: $Xlsx = new \Aimeos\Shop\Command\JobsCommand();
How can I do the implementing and configure this JobsCommand;
The controller working correctly on console command
php artisan aimeos:jobs "product/import/xlsx" "default"
php artisan aimeos:jobs "product/export/xlsx" "default"
I want to implement this job controler like aimeos: $Xlsx = new \Aimeos\Shop\Command\JobsCommand();
How can I do the implementing and configure this JobsCommand;
Re: Run Aimeos jobs in Laravel controller
Don't know if this is really useful but if you want to have an own, specific command, you can use the aimeos:jobs command as reference:
https://github.com/aimeos/aimeos-larave ... ommand.php
https://github.com/aimeos/aimeos-larave ... ommand.php
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
- tulparstudyo
- Posts: 3
- Joined: 03 Mar 2021, 08:39
Re: Run Aimeos jobs in Laravel controller
Thanks,
I solved the problem. Now I can product import and product export on the admin panel by xlsx file upload.
https://github.com/tulparstudyo/sw-xlsx
I solved the problem. Now I can product import and product export on the admin panel by xlsx file upload.
https://github.com/tulparstudyo/sw-xlsx
-
- Posts: 19
- Joined: 06 Mar 2021, 14:51
Re: Run Aimeos jobs in Laravel controller
@tulparstudyo Can you please explain this "https://github.com/tulparstudyo/sw-xlsx"