PHPackages                             olubunmitosin/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. olubunmitosin/laravel-pricing-plans

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

olubunmitosin/laravel-pricing-plans
===================================

A package provide pricing plans for Laravel.

v0.4.3(4y ago)191[1 PRs](https://github.com/olubunmitosin/laravel-pricing-plans/pulls)MITPHPPHP &gt;=7.3|^8.0

Since Jan 9Pushed 4y agoCompare

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

READMEChangelogDependencies (11)Versions (20)Used By (0)

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

[](#laravel-pricing-plans)

[![Build Status](https://camo.githubusercontent.com/b8b0f7c2328c355fdc43bde4ee83eee471ec6ee971d7d7739be61fa09e0702f4/68747470733a2f2f7472617669732d63692e636f6d2f68656e6f6333352f6c61726176656c2d70726963696e672d706c616e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/henoc35/laravel-pricing-plans)[![Coverage Status](https://camo.githubusercontent.com/b34e8be98363a9b913ab606109a3933cd20734e8377bc5ed494dcd4529fff60b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f68656e6f6333352f6c61726176656c2d70726963696e672d706c616e732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/henoc35/laravel-pricing-plans?branch=master)[![Latest Version](https://camo.githubusercontent.com/35b82c9802a835ec7b424356a82365f0f5220ed5e66c2eafd46cb8a732077340/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f68656e6f6333352f6c61726176656c2d70726963696e672d706c616e732e7376673f7374796c653d666c61742d737175617265)](https://github.com/henoc35/laravel-pricing-plans/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Easy provide pricing plans for Your Laravel 8.+ 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)
    - [Group model](#group-model)
    - [PlanFeature model](#planfeature-model)
    - [PlanGroup model](#plangroup-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)
    - [Create a group of plans](#create-a-group-of-plans)
    - [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 8.+ Application.

TODO
----

[](#todo)

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

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

[](#requirements)

- php &gt;=7.3
- Laravel 8.+

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

[](#installation)

### Composer

[](#composer)

Begin by pulling in the package through Composer.

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

### Service Provider

[](#service-provider)

Next, if using Laravel 8.+, 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:

```
