PHPackages                             oanhnn/laravel-pricing-plans - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. oanhnn/laravel-pricing-plans

ActiveLibrary[Payment Processing](/categories/payments)

oanhnn/laravel-pricing-plans
============================

A package provide pricing plans for Laravel.

v0.3.3(7y ago)5954922[3 issues](https://github.com/oanhnn/laravel-pricing-plans/issues)[2 PRs](https://github.com/oanhnn/laravel-pricing-plans/pulls)MITPHPPHP &gt;=7.0

Since Jan 9Pushed 1y ago6 watchersCompare

[ Source](https://github.com/oanhnn/laravel-pricing-plans)[ Packagist](https://packagist.org/packages/oanhnn/laravel-pricing-plans)[ Docs](https://github.com/oanhnn/laravel-pricing-plans)[ RSS](/packages/oanhnn-laravel-pricing-plans/feed)WikiDiscussions master Synced yesterday

READMEChangelog (9)Dependencies (9)Versions (11)Used By (0)

Laravel Pricing Plans
=====================

[](#laravel-pricing-plans)

[![Build Status](https://camo.githubusercontent.com/00d432d45d36dbada21c336a818083899ba3b6025d6fd80aa677d8e126c52d10/68747470733a2f2f7472617669732d63692e6f72672f6f616e686e6e2f6c61726176656c2d70726963696e672d706c616e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/oanhnn/laravel-pricing-plans)[![Coverage Status](https://camo.githubusercontent.com/539ae8ccd2af52384c24f83a4e90eedc08a6566cea6e7a2711079fb7e3df9d42/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6f616e686e6e2f6c61726176656c2d70726963696e672d706c616e732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/oanhnn/laravel-pricing-plans?branch=master)[![Latest Version](https://camo.githubusercontent.com/ed45d7610bda799ad2bfde2bb76fb761720b9e0a05c003a070e08e0e0be0979e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6f616e686e6e2f6c61726176656c2d70726963696e672d706c616e732e7376673f7374796c653d666c61742d737175617265)](https://github.com/oanhnn/laravel-pricing-plans/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Easy provide pricing plans for Your Laravel 5.4+ Application.

- [Main features](#main-features)
- [TODO](#todo)
- [Requirements](#requirements)
- [Installation](#installation)
    - [Composer](#composer)
    - [Service Provider](#service-provider)
    - [Config file and Migrations](#config-file-and-migrations)
    - [Contract and Traits](#contract-and-traits)
- [Config File](#config-file)
- [Models](#models)
    - [Feature model](#feature-model)
    - [Plan model](#plan-model)
    - [PlanFeature model](#planfeature-model)
    - [PlanSubscription model](#plansubscription-model)
    - [PlanSubscriptionUsage model](#plansubscriptionusage-model)
- [Events](#events)
    - [SubscriptionRenewed event](#subscriptionrenewed-event)
    - [SubscriptionCanceled event](#subscriptioncanceled-event)
    - [SubscriptionPlanChanged event](#subscriptionplanchanged-event)
- [Usage](#usage)
    - [Create features and plan](#create-features-and-plan)
    - [Creating subscriptions](#creating-subscriptions)
    - [Subscription Ability](#subscription-ability)
    - [Record Feature Usage](#record-feature-usage)
    - [Reduce Feature Usage](#reduce-feature-usage)
    - [Clear The Subscription Usage Data](#clear-the-subscription-usage-data)
    - [Check Subscription Status](#check-subscription-status)
    - [Renew a Subscription](#renew-a-subscription)
    - [Cancel a Subscription](#cancel-a-subscription)
    - [Scopes](#scopes)
- [Changelog](#changelog)
- [Testing](#testing)
- [Contributing](#contributing)
- [Security](#security)
- [Credits](#credits)
- [License](#license)

Main features
-------------

[](#main-features)

Easy provide pricing plans for Your Laravel 5.4+ Application.

TODO
----

[](#todo)

- Caching some select query
- Add unit test scripts
- Make better documents

Requirements
------------

[](#requirements)

- php &gt;=7.0
- Laravel 5.4+

Installation
------------

[](#installation)

### Composer

[](#composer)

Begin by pulling in the package through Composer.

```
$ composer require oanhnn/laravel-pricing-plans
```

### Service Provider

[](#service-provider)

Next, if using Laravel 5.5+, you done. If using Laravel 5.4, you must include the service provider within your `config/app.php` file.

```
// config/app.php

    'providers' => [
        // Other service providers...

        Laravel\PricingPlans\PricingPlansServiceProvider::class,
    ],
```

### Config file and Migrations

[](#config-file-and-migrations)

Publish package config file and migrations with the command:

```
$ php artisan vendor:publish --provider="Laravel\PricingPlans\PricingPlansServiceProvider"
```

Then run migrations:

```
$ php artisan migrate
```

### Contract and Traits

[](#contract-and-traits)

Add `Laravel\PricingPlans\Contacts\Subscriber` contract and `Laravel\PricingPlans\Models\Concerns\Subscribable` trait to your subscriber model (Eg. `User`).

See the following example:

```
