承接 ricadesign/laravel-cart 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ricadesign/laravel-cart

Composer 安装命令:

composer require ricadesign/laravel-cart

包简介

Laravel shopping Cart

README 文档

README

Welcome to the Laravel Cart Package! This package provides a complete solution for adding cart functionality to your Laravel application. It also includes pre-configured endpoints so you can consume the cart quickly and easily.

Installation

You can install this package using Composer. Run the following command in your terminal:

composer require ricadesign/laravel-cart

You can publish the package configurations (useful if you plan to have full control), run the following command:

php artisan vendor:publish --provider="Darryldecode\Cart\CartServiceProvider\LaravelCart\CartServiceProvider" --tag="config"
php artisan vendor:publish --provider="Ricadesign\LaravelCart\LaravelCartServiceProvider" --tag="config"

Configuration

By default, the cart is stored in the user's session. However, if you want to change this configuration to store the cart in the database, you need to add the following line to the config/shopping_cart.php configuration file:

'storage' => 'Ricadesign\LaravelCart\DBStorage',

After configure storage, you must run:

php artisan migrate

In case you are using DBStorage, you can configure the number of days you want to remain the cart on database in config/laravel-cart.php configuration file:

'prunable_days' => 14,

In order to clear periodically the database_carts table you can include this line in schedule:

$schedule->command('model:prune', [
            '--model' => [DatabaseStorageModel::class],
        ])->daily();

Endpoints

This package includes a set of pre-configured endpoints that allow you to manage the cart quickly and easily. The endpoints are protected by default authentication, so only authenticated users can perform actions on the cart.

  • GET /api/cart: returns the contents of the cart.
  • POST /api/cart: adds a product to the cart. The request body must include the product id, name, price, quantity and optionally an array of options.
  • PUT /api/cart: updates the quantity of a product in the cart.
  • PUT /api/cart/increment: updates the quantity of a product in the cart.
  • DELETE /api/cart: removes a product from the cart.

Contributions

If you want to contribute to this package, you can fork the repository on GitHub and send a pull request with your changes. We also appreciate you reporting any issues or bugs you find in the issues section of the repository.

统计信息

  • 总下载量: 308
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固