承接 moirei/laravel-pricing 相关项目开发

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

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

moirei/laravel-pricing

Composer 安装命令:

composer require moirei/laravel-pricing

包简介

Easily manage complex pricing.

README 文档

README

Manage complex pricing for your eloquent models.

To use in frontend or Node.js, checkout moirei/complex-pricing.

Documentation

All documentation is available at the documentation site.

Example

...
$product = Product::find(1);

$product->pricing([
    'model' => 'volume',
    'tiers' => [
      [
        'max' => 5,
        'unit_amount' => 3.6,
      ],
      [
        'max' => 10,
        'unit_amount' => 3.3,
      ],
      [
        'max' => 'infinity', // or `-1`
        'unit_amount' => 3.1,
        'flat_amount' => 1.2,
      ],
    ]
  ],
]);

$price = $product->price; // price for 1 item

$price = $product->price(4); // price = 4 x 3.6 = 14.4
$price = $product->price(7); // price = 7 x 3.3 = 23.1
$price = $product->price(15); // price = (15 x 3.1) + 1.2 = 47.7

Installation

composer require moirei/laravel-pricing

Concept

In large applications, pricing for provided goods or service are often not straight forward. For instance, you might want to charge $10 on an item for every 5 units purchased in AU, while at the same time, for your customers in US, regressively charge $50, $40, $30 for every quantity ranged between 0-30, 31-40, 50-infinity respectively.

This package has the concept of standard, package, volume, and graduated pricing intended to cover most (if not all) complex pricing scenarios. It also allows naming for multi-currency and multi-region use cases.

Changelog

Please see CHANGELOG.

Credits

Tests

composer run test

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-06-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固