Aimeos Multi Vendor and Laravel 9 with Vue 2 Frontend

Help for integrating the Laravel package
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!
rhand
Posts: 23
Joined: 12 Apr 2024, 03:06

Aimeos Multi Vendor and Laravel 9 with Vue 2 Frontend

Post by rhand » 12 Apr 2024, 04:30

Completely newbie to Aimeos and excited but with a lot of questions

I installed LTS release: 2023.10 (Laravel 9.x, 10.x and 11.x) to work with Laravel 9 as we still use it with Vue 2 and Laravel Mix. It installed just fine. I saw many files were added to public/vendor . Is that normal? Seems to be and it is done with `vendor/aimeos/aimeos-laravel/src/ShopServiceProvider.php` using:

Code: Select all

> App\Providers\EventServiceProvider::postAutoloadDump
138 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
> @php artisan vendor:publish --tag=laravel-assets --ansi --force

   INFO  Publishing [laravel-assets] assets.  

  Copying directory [vendor/laravel/horizon/public] to [public/vendor/horizon] ...................................................... DONE

> @php artisan vendor:publish --tag=public --ansi

   INFO  Publishing [public] assets.  

  Copying directory [vendor/aimeos/aimeos-laravel/public] to [public/vendor/shop] ................................................... DONE
  Copying directory [vendor/aimeos/ai-client-html/themes/client/html] to [public/vendor/shop/themes] ................................ DONE
  Copying directory [vendor/aimeos/ai-cms-grapesjs/themes/client/html] to [public/vendor/shop/themes] ............................... DONE

> \Aimeos\Shop\Composer::join
No security vulnerability advisories found
But it is not clear why we would want to add folders and especially the vendor folder for Aimeos and Horizon to the public folder. I could override with something like

Code: Select all

<?php

namespace App\Providers;

use Aimeos\Shop\ShopServiceProvider as AimeosServiceProvider;

class CustomAimeosServiceProvider extends AimeosServiceProvider
{
    // Override methods here
}
...
But Aimeos must have its reasons. Why is this done?
Next step seems to be:

Code: Select all

php artisan vendor:publish --tag=config --tag=public
php artisan migrate
php artisan aimeos:setup --option=setup/default/demo:1
But we do not need the demo as we publish our own display based on our editor. So I guess I can do the two step minus the last one?

Three, I want to be able to click a button to add a shop to a client's project using multi vendor?. What would you recommend for this? Attach the click to a Laravel command to run the Aimeos command to create a shop? How would I then grab the id to load the shop view for this user so he gets his shop and not someone else's shop?

And finally , if I want to load in shop overview using the Aimeos API / JSON and also for a product single view, cart and checkout. Where can I find documentation to load the data in a Vue/HTML/CSS display?

User avatar
aimeos
Administrator
Posts: 8015
Joined: 01 Jan 1970, 00:00

Re: Aimeos Multi Vendor and Laravel 9 with Vue 2 Frontend

Post by aimeos » 12 Apr 2024, 17:51

rhand wrote: 12 Apr 2024, 04:30 I installed LTS release: 2023.10 (Laravel 9.x, 10.x and 11.x) to work with Laravel 9 as we still use it with Vue 2 and Laravel Mix. It installed just fine. I saw many files were added to public/vendor . Is that normal? Seems to be and it is done with
But it is not clear why we would want to add folders and especially the vendor folder for Aimeos and Horizon to the public folder. But Aimeos must have its reasons. Why is this done?
The files in the ./public/vendor/ directory are the CSS and JS files for the HTML frontend. You need them in every standard setup for the styling and the dynamic features of the frontend.
rhand wrote: 12 Apr 2024, 04:30 Next step seems to be:

Code: Select all

php artisan vendor:publish --tag=config --tag=public
php artisan migrate
php artisan aimeos:setup --option=setup/default/demo:1
But we do not need the demo as we publish our own display based on our editor. So I guess I can do the two step minus the last one?
If you don't want to add the demo data, use:

Code: Select all

php artisan vendor:publish --tag=config --tag=public
php artisan migrate
php artisan aimeos:setup
To remove the demo data from an existing setup:

Code: Select all

php artisan aimeos:setup --option=setup/default/demo:0
rhand wrote: 12 Apr 2024, 04:30 Three, I want to be able to click a button to add a shop to a client's project using multi vendor?. What would you recommend for this? Attach the click to a Laravel command to run the Aimeos command to create a shop? How would I then grab the id to load the shop view for this user so he gets his shop and not someone else's shop?
If you want a SaaS solution (independent shops, not a marketplace), then please read here:
https://aimeos.org/docs/latest/laravel/ ... iple-shops
rhand wrote: 12 Apr 2024, 04:30 And finally , if I want to load in shop overview using the Aimeos API / JSON and also for a product single view, cart and checkout. Where can I find documentation to load the data in a Vue/HTML/CSS display?
The Aimeos JSON API for the frontend is described here:
https://aimeos.org/docs/latest/frontend/jsonapi/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply