webzera/laracart

此购物车包适用于laravel电子商务

dev-master 2022-10-01 05:24 UTC

This package is not auto-updated.

Last update: 2024-09-28 17:17:53 UTC


README

  • PHP >= 7.3.0
  • Laravel >= 7.0.0

安装

并确保电子商务网站首页中的产品视图页面完成,'添加购物车'按钮的链接是 {{ route('cart::add', $product) }}

-这里的 $product 是 '单个产品对象'。

从数据库源文件夹 webzera/laracart 下载 products 表格、工厂和种子文件。

在使用工厂文件之前,请确保 Product 模型已创建。

php artisan tinker
factory('App\Product', 50)->create()

首先,安装 laravel 7,并确保数据库连接设置正确。

composer require webzera/laracart

或者

php composer.phar require webzera/laracart

php artisan vendor:publish --force

在浏览器中打开 https:///cart/