- Notifications
You must be signed in to change notification settings - Fork1.1k
Laravel ecommerce package for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce
License
aimeos/aimeos-laravel
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
⭐ Star us on GitHub — it motivates us a lot! 😀
Aimeos is THE professional, full-featured andultra fast Laravel ecommerce package! You can install it in yourexisting Laravel application within 5 minutes and can adapt, extend, overwriteand customize anything to your needs.
Aimeos is a full-featured e-commerce package:
- Multi vendor, multi channel and multi warehouse
- From one to 1,000,000,000+ items
- Extremly fast down to 20ms
- For multi-tentant e-commerce SaaS solutions with unlimited vendors
- Bundles, vouchers, virtual, configurable, custom and event products
- Subscriptions with recurring payments
- 100+ payment gateways
- Full RTL support (frontend and backend)
- Block/tier pricing out of the box
- Extension for customer/group based prices
- Discount and voucher support
- Flexible basket rule system
- Full-featured admin backend
- Beautiful admin dashboard
- Configurable product data sets
- JSON REST API based on jsonapi.org
- GraphQL API for administration
- Completly modular structure
- Extremely configurable and extensible
- Extension for market places with millions of vendors
- Fully SEO optimized including rich snippets
- Translated to 30+ languages
- AI-based text translation
- Optimized for smart phones and tablets
- Secure and reviewed implementation
- High quality source code
... andmore Aimeos features
Supported languages:
Check out the demos:
If you want to set up a new application or test Aimeos, we recommend the Aimeosshop distribution. It contains everything for a quick start and you will get afully working online shop in less than 5 minutes:
If you want to build a single page application (SPA) respectively a progressive webapplication (PWA) yourself and don't need the Aimeos HTML frontend, then the Aimeosheadless distribution is the right choice:
Currently, the Aimeos Laravel packages2023.10 and later are fully supported:
- LTS release: 2024.10+ (Laravel 10.x and 11.x)
- Old LTS release: 2023.10 (Laravel 9.x, 10.x and 11.x)
If you want to upgrade between major versions, please have a look into theupgrade guide!
The Aimeos shop distribution requires:
- Linux/Unix, WAMP/XAMP or MacOS environment
- PHP >= 8.1
- MySQL >= 5.7.8, MariaDB >= 10.2.2, PostgreSQL 9.6+, SQL Server 2019+
- Web server (Apache, Nginx or integrated PHP web server for testing)
If required PHP extensions are missing,composer
will tell you about the missingdependencies.
If you want to upgrade between major versions, please have a look into theupgrade guide!
Make sure that you'vecreated the database in advance and added the configurationto the.env
file in your application directory. Sometimes, using the .env file makesproblems and you will get exceptions that the connection to the database failed. In thatcase, add the database credentials to theresource/db section of your ./config/shop.phpfile too!
If you don't have at least MySQL 5.7.8 or MariaDB 10.2.2 installed, you will probably get an error like
Specified key was too long; max key length is 767 bytes
To circumvent this problem, drop the new tables if there have been any created andchange the charset/collation setting in./config/database.php
to these values beforeinstalling Aimeos again:
'connections' => ['mysql' => [// ...'charset' =>'utf8','collation' =>'utf8_unicode_ci',// ... ]]
Caution: Also make sure that your MySQL server createsInnoDB tables by default asMyISAMtables won't work and will result in an foreign key constraint error!
If you want to use a database server other than MySQL, please have a look into the article aboutsupported database serversand their specific configuration. Supported are:
- MySQL, MariaDB (fully)
- PostgreSQL (fully)
- SQL Server (fully)
Make sure, you use one of the supported database servers in your.env
file, e.g.:
DB_CONNECTION=mysqlDB_HOST=127.0.0.1DB_PORT=3306DB_DATABASE=aimeosDB_USERNAME=rootDB_PASSWORD=
Caution: The SQLite database configured by default isNOT supported!
The Aimeos Laravel online shop package is a composer based library. It can beinstalled easiest by usingComposer 2.1+ in the rootdirectory of your existing Laravel application:
wget https://getcomposer.org/download/latest-stable/composer.phar -O composer
Then, add these lines to the composer.json of theLaravel skeleton application:
"prefer-stable":true,"minimum-stability":"dev","require": {"aimeos/aimeos-laravel":"~2024.10",... },"scripts": {"post-update-cmd": ["@php artisan vendor:publish --tag=laravel-assets --ansi --force","@php artisan vendor:publish --tag=public --ansi","\\Aimeos\\Shop\\Composer::join" ],... }
Afterward, install the Aimeos shop package using
php composer update -W
In the last step, you must now execute these artisan commands to get a workingor updated Aimeos installation:
php artisan vendor:publish --tag=config --tag=publicphp artisan migratephp artisan aimeos:setup --option=setup/default/demo:1
In a production environment or if you don't want that the demo data getsinstalled, leave out the--option=setup/default/demo:1
option.
You have to set up one of Laravel's authentication starter kits. Laravel Breezeis the easiest one but you can also use Jetstream.
composer require laravel/breezephp artisan breeze:installnpm install&& npm run build# if not executed automatically by the previous command
Laravel Breeze will ask you a few questions, the most important one is the type of stack youwant to use. Select "Blade" (it's the easiest way) and use the default values for the others.
It also adds a route for/profile
to./routes/web.php
which may overwrite theaimeos_shop_account
route. To avoid an exception about a missingaimeos_shop_account
route, change the URL for these lines from./routes/web.php
file from/profile
to/profile/me
:
Route::middleware('auth')->group(function () { Route::get('/profile/me', [ProfileController::class,'edit'])->name('profile.edit'); Route::patch('/profile/me', [ProfileController::class,'update'])->name('profile.update'); Route::delete('/profile/me', [ProfileController::class,'destroy'])->name('profile.destroy');});
For more information, please follow the Laravel documentation:
As a last step, you need to extend theboot()
method of yourApp\Providers\AppServiceProvider
class and add the lines to define howauthorization for "admin" is checked inapp/Providers/AppServiceProvider.php
:
publicfunctionboot() {// Keep the lines before \Illuminate\Support\Facades\Gate::define('admin',function($user,$class,$roles) {if(isset($user->superuser ) &&$user->superuser ) {returntrue; }returnapp('\Aimeos\Shop\Base\Support' )->checkUserGroup($user,$roles ); }); }
Test if your authentication setup works before you continue. Create an admin accountfor your Laravel application so you will be able to log into the Aimeos admin interface:
php artisan aimeos:account --super<email>
The e-mail address is the user name for login and the account will work for thefrontend too. To protect the new account, the command will ask you for a password.The same command can create limited accounts by using--admin
,--editor
or--api
instead of--super
(access to everything).
To reference images correctly, you have to adapt your.env
file and set theAPP_URL
to your real URL, e.g.
APP_URL=http://127.0.0.1:8000
Caution: Make sure, Laravel uses thefile
session driver in your.env
file!Otherwise, the shopping basket content won't get stored correctly!
SESSION_DRIVER=file
If your./public
directory isn't writable by your web server, you have to create thesedirectories:
mkdir public/aimeos public/vendorchmod 777 public/aimeos public/vendor
In a production environment, you should be more specific about the granted permissions!
Then, you should be able to call the catalog list page in your browser. For aquick start, you can use the integrated web server. Simply execute this commandin the base directory of your application:
php artisan serve
Point your browser to the list page of the shop using:
- 2024.x+:http://127.0.0.1:8000/shop/search
- 2023.x:http://127.0.0.1:8000/shop
Note: Integrating the Aimeos package adds some routes like/shop
or/admin
to yourLaravel installation but thehome page stays untouched! If you want to add Aimeos tothe home page as well, replace the route for "/" in./routes/web.php
by this line:
Route::group(['middleware' => ['web']],function () { Route::get('/','\Aimeos\Shop\Controller\CatalogController@homeAction')->name('aimeos_home');});
For multi-vendor setups, read the article aboutmultiple shops.
This will display the Aimeos catalog home component on the home page you you get anice looking shop home page which will look like this:
If you've still started the internal PHP web server (php artisan serve
)you should now open this URL in your browser:
Enter the e-mail address and the password of the newly created user and press "Login".If you don't get redirected to the admin interface (that depends on the authenticationcode you've created according to the Laravel documentation), point your browser to the/admin
URL again.
Caution: Make sure that you aren't already logged in as a non-admin user! In thiscase, login won't work because Laravel requires you to log out first.
To simplify development, you should configure to use no content cache. You cando this in theconfig/shop.php
file of your Laravel application by addingthese lines at the bottom:
'madmin' => ['cache' => ['manager' => ['name' =>'None', ], ], ],
The Aimeos Laravel package is licensed under the terms of the MIT license andis available for free.
About
Laravel ecommerce package for ultra fast online shops, scalable marketplaces, complex B2B applications and #gigacommerce