webleit/laravel-spark-dynamic-plan-provider 问题修复 & 功能扩展

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

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

webleit/laravel-spark-dynamic-plan-provider

Composer 安装命令:

composer require webleit/laravel-spark-dynamic-plan-provider

包简介

README 文档

README

Laravel Spark Service Provider that allows to create Plans with Eloquent and have them created on Stripe, automatically loading them into Spark.

Installation

composer require webleit/laravel-spark-dynamic-plan-provider

Usage

The Service Provider will autoregister itself into laravel.

After that, just create a Plan as you do with any Eloquent model, and it will be created into Stripe first (you need to have your stripe api key set into the services configuration file), then loaded into Spark.

<?php

...

use Webleit\LaravelSparkDynamicPlanProvider\Plan;

...

Plan::create([
  'name' => 'My test plan name',
  'provider_id' => 'stripe-plan-id',
  'description' => 'test description',
  'price' => 9.99, // Tax excluded, it will apply taxes automatically using your Spark config
  'trial' => 30, // Days of trial
  'period' => Plan::PERIOD_MONTHLY, // or Plan::PERIOD_YEARLY
  'features' => [
    'feature 1',
    'feature 2'
  ]
]);

You can than use that as any other eloquent model. You can always retrieve Spark's plan using $plan->asSparkPlan()

Config

[
    /**
     * Cache Store to use for caching Spark plans.
     * Null disables the caching
     */
    'cache' => null,

    /**
     * Should the provider autoconfigure the Spark plans on boot?
     */
    'autoload' => true

]

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固