当前位置: 首页 > 软件库 > Web应用开发 > Web框架 >

aimeos-laravel

授权协议 MIT License
开发语言 PHP
所属分类 Web应用开发、 Web框架
软件类型 开源软件
地区 不详
投 递 者 耿星雨
操作系统 跨平台
开源组织
适用人群 未知
 软件概览
Aimeos logo

Aimeos Laravel ecommerce package

Star us on GitHub — it helps!

Aimeos is THE professional, full-featured andultra fast e-commerce package for Laravel! You can install it in yourexisting Laravel application within 5 minutes and can adapt, extend, overwriteand customize anything to your needs.

Aimeos Laravel demo

Table of content

Supported versions

This document is for the Aimeos Laravel package 2021.10 and later.

  • LTS release: 2021.10 (6.x, 7.x and 8.x)

If you want to upgrade between major versions, please have a look into theupgrade guide!

Basic application

Full shop application

If you want to set up a new application or test Aimeos, we recommend theAimeos shop application. You needcomposer 2.1+ to install Aimeos.

It will install a complete shop system including demo data for a quick startwithout the need to follow the steps described in this readme.

wget https://getcomposer.org/download/latest-stable/composer.phar -O composer
php composer create-project aimeos/aimeos myshop

More about the full package: Aimeos shop

Shop package only

The Aimeos Laravel online shop package is a composer based library. It can beinstalled easiest by using Composer 2.1+ in the rootdirectory of your exisisting Laravel application:

wget https://getcomposer.org/download/latest-stable/composer.phar -O composer
php composer require aimeos/aimeos-laravel:~2021.10

Database

Make sure that you've created 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 the resource/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',
        // ...
    ]
]

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)

Installation

Then, add these lines to the composer.json of the Laravel skeleton application:

    "prefer-stable": true,
    "minimum-stability": "dev",
    "require": {
        "aimeos/aimeos-laravel": "~2021.10",
        ...
    },
    "scripts": {
        "post-update-cmd": [
            "@php artisan migrate",
            "@php artisan vendor:publish --tag=public --force",
            "\\Aimeos\\Shop\\Composer::join"
        ],
        ...
    }

Afterwards, install the Aimeos shop package using

composer update

In the last step you must now execute these artisan commands to get a workingor updated Aimeos installation:

php artisan vendor:publish --all
php artisan migrate
php 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.

Setup

To reference images correctly, you have to adapt your .env file and set the APP_URLto your real URL, e.g.

APP_URL=http://127.0.0.1:8000

Caution: Make sure, Laravel uses the file session driver in your .env file!Otherwise, the shopping basket content won't get stored correctly!

SESSION_DRIVER=file

Then, you should be able to call the catalog list page in your browser. For aquick start, you can use the integrated web server that is available since PHP 5.4.Simply execute this command in the base directory of your application:

php artisan serve

Point your browser to the list page of the shop using:

http://127.0.0.1:8000/index.php/shop

Note: Integrating the Aimeos package adds some routes like /shop or /admin to yourLaravel installation but the home 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 about multiple shops.

This will display the Aimeos catalog home component on the home page you you get anice looking shop home page. The /shop page will look like:

Aimeos frontend

Admin

To use the admin interface, you have to set up Laravel authentication first:

Laravel 8

composer require laravel/jetstream
php artisan jetstream:install livewire
npm install && npm run dev

For more information, please follow the Laravel documentation:

Laravel 7

composer require laravel/ui:^2.0
php artisan ui vue --auth
npm install && npm run dev

For more information, please follow the Laravel documentation:

Laravel 6

composer require laravel/ui:^1.0
php artisan ui vue --auth
npm install && npm run dev

For more information, please follow the Laravel documentation:

Create account

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).

Configure authentication

As a last step, you need to extend the boot() method of yourApp\Providers\AuthServiceProvider class and add the lines to define howauthorization for "admin" is checked in app/Providers/AuthServiceProvider.php:

public function boot()
    {
        // Keep the lines before

        Gate::define('admin', function($user, $class, $roles) {
            if( isset( $user->superuser ) && $user->superuser ) {
                return true;
            }
            return app( '\Aimeos\Shop\Base\Support' )->checkUserGroup( $user, $roles );
        });
    }

Test

If your ./public directory isn't writable by your web server, you have to create thesedirectories:

mkdir public/aimeos public/vendor
chmod 777 public/aimeos public/vendor

In a production environment, you should be more specific about the granted permissions!If you've still started the internal PHP web server (php artisan serve)you should now open this URL in your browser:

http://127.0.0.1:8000/index.php/admin

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 to log out first.

Aimeos backend

Hints

To simplify development, you should configure to use no content cache. You cando this in the config/shop.php file of your Laravel application by addingthese lines at the bottom:

'madmin' => array(
        'cache' => array(
            'manager' => array(
                'name' => 'None',
            ),
        ),
    ),

License

The Aimeos Laravel package is licensed under the terms of the MIT license andis available for free.

Links

 相关资料
  • ⭐ Star us on GitHub — it motivates us a lot! �� Aimeos Laravel ecommerce platform Aimeos is THE professional, full-featured andhigh performance e-commerce platform! You can install it within 5 minutes

  • 我尝试为symfony安装aimeos捆绑包,但出现以下错误: 您的PHP版本5.5.1受到CVE-2013-6420的影响,无法安全地执行rm证书验证,我们强烈建议您升级。用包信息加载作曲家存储库更新依赖项(包括要求开发)您的需求无法解析为一组可安装的包。 问题1-aimeos/aimeos symfony的安装请求~2016.04- 潜在原因:-软件包名称输入错误-根据最小最小最小稳定性设置,

  • 问题内容: 我在控制器的函数中。 因此,从表单中,我得到了一个变量的值,说: 然后,我需要在WHERE语句中嵌入该变量(即它的值)。如果我对值进行硬编码,它将带来正确的结果,但是我已经尝试了各种方法来插入该变量而没有成功。好吧,假设我设法使用了该变量,那么我将不得不研究绑定以避免SQL注入,但是到目前为止,我要说的是,看看该变量是否可以在查询中使用。 我已经试过了,双引号,串联。$ vx。,花括号

  • 问题内容: 我需要解密从服务器接收到的一些数据,编写API的程序员将我定向到此Encrypter类,以查看他过去用于加密的内容。 现在基于该类,我发现所使用的算法是AES128 CBC,并且我接收到的字符串是Base64编码的,并且包含其他数据,而不仅仅是密文。 即,如果我收到以下字符串: 经过base64解码后,我得到: 基于的类(),I执行另一解码的base64上和,并得到了一个长度为16的那

  • 问题内容: 我已经将laravel存储库克隆到了CentOS 7盒中。当我尝试运行它时,出现500错误,但未显示任何内容。 因此,我进行了检查,发现有一些权限错误: 我做了以下尝试来克服这些问题: 所以现在显示如下: 但这没有用。 有趣的是,我之前输入了一些错误的命令,这些命令似乎将日志添加到日志文件中。 问题答案: 我找到了答案,解决了我的问题。 通过关闭命令来证明这是问题所在 这应该允许写入,

  • 问题内容: 数据库表中有一个类型列。但它没有按我预期的那样工作。 问题是 我需要在列中放入零,但每次尝试添加带有的记录时,它的价值都会增加。 我在这里发现了一个问题。。但是答案并没有说明问题的原因。很高兴有人可以解释这个问题。 问题答案: 具有类型字段意味着您每次插入/更新该字段时都需要使用原始值作为解决方法。 这是因为默认情况下,PDO将绑定这些值,并将它们视为字符串,因此将导致: 我建议将其更