typicms/subscriptions
Composer 安装命令:
composer require typicms/subscriptions
包简介
README 文档
README
This module is part of TypiCMS, a multilingual CMS based on the Laravel framework.
It allows you to setup a subscriptions management system based on Laravel Cashier for Mollie.
Installation
Prerequisites
- You must have a working installation of TypiCMS
- Make sure your
APP_URLin.envis correctly set.
Install the package
composer require typicms/subscriptions
Add the service provider:
// config/app.php /* * TypiCMS Modules Service Providers. * Here is the place for your modules, * they should be set before Core Service provider. */ … TypiCMS\Modules\Subscriptions\Providers\ModuleServiceProvider::class, …
Configure your app
Add the cashier model and the mollie key in your .env environment file:
CASHIER_MODEL=TypiCMS\Modules\Core\Models\User MOLLIE_KEY="test_12345678912345678912345678912345"
Publish the Users module and add the BillableUser trait to the User model.
php artisan typicms:publish Users
Modify the User model like this:
… use TypiCMS\Modules\Subscriptions\Traits\BillableUser; … class User extends Model implements … { … use BillableUser; … }
More information can be found here
Mass-assignement
If needed, allow the following fields to be fillable.
protected $fillable = [ 'tax_percentage', 'mollie_customer_id', 'mollie_mandate_id', 'tax_percentage', 'trial_ends_at', 'extra_billing_information' ];
Run the installation script
Install Cashier and migrate the database.
php artisan subscriptions:install
Import the scss files
Edit resources/scss/public.scss and add:
@import 'public/account'; @import 'public/plan-list';
Run npm run dev to compile the public.css file.
Configure Cashier
Configure your subscription plans in config/cashier_plans.php.
Manage any coupons in config/cashier_coupons.php. By default an example coupon is enabled, consider disabling it before deploying to production.
Setup your app
Create a page linked to the Subscriptions module and navigate to it.
Pre-build Plans Template
Quickly build an effective pricing table for your potential customers with the template created under /plans and linked to the PublicController@plans controller.
Customize Invoices
Copy the Cashier package views using the following command:
php artisan vendor:publish --provider="Laravel\Cashier\CashierServiceProvider" --tag="cashier-views"
You can customize the /resources/views/vendor/cashier/ files as you like.
Tax Management
To specify the tax percentage a user pays on a subscription, edit the tax_percentage column for the user in the database.
The displayed price on the subscription has built-in tax calculation.
Additional information
typicms/subscriptions 适用场景与选型建议
typicms/subscriptions 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 141 次下载、GitHub Stars 达 3, 最近一次更新时间为 2020 年 02 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 typicms/subscriptions 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 typicms/subscriptions 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 141
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-05
