jeanfprado/cashier 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

jeanfprado/cashier

最新稳定版本:0.1.6

Composer 安装命令:

composer require jeanfprado/cashier

包简介

Cashier provides a subscription billing services.

README 文档

README

Cashier provides a subscription billing services. It handles almost all of the boilerplate subscription billing code you are dreading writing. In addition to basic subscription management, Cashier can handle plans.

Documentation

Installation

You can pull in the package via composer:

composer require jeanfprado/cashier

The package will automatically register itself.

Configuration

Laravel without auto-discovery:

If you don't use auto-discovery, add the CashierServiceProvider to the providers array in config/app.php

Jeanfprado\Cashier\CashierServiceProvider::class,

If you want to use the facade to log messages, add this to your facades in app.php:

'Cashier' => Jeanfprado\Cashier\Support\Facade\Cashier::class,

Copy the package config to your local config with the publish command:

php artisan vendor:publish --provider="Jeanfprado\Cashier\CashierServiceProvider"

Plan

Creating all plans from config/cashier.php via artisan

php artisan cashier:seed-plans

Subscription

Before you create a subscription you need prepare what class will be subscribable

In config/cashier.php change key model to model that will be a subscribable.

Now in this model you need implements a contract. see example:

<?php

namespace App;

use Jeanfprado\Cashier\Subscribable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Notifications\Notifiable;
use Jeanfprado\Cashier\Contracts\Subscribable as SubscribableContract;


class User extends Model implements SubscribableContract
{
    use Notifiable,
        Subscribable;
    ...
}

Now you can to create a subscription.

 $user->subscribe($plan);

Billing

Creating a billing is very easy, you only need run a command.

    php artisan cashier:subscription-check

Than if has a billing to generate is done, and when the billing is paid, you need mark to paid.

    $billing->markToPaid();

Contributing

Thank you for considering contributing to Cashier!

License

Cashier is open-sourced software licensed under the MIT license.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固