PHPackages                             logicalcrow/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. logicalcrow/pricing-plans

ActiveLibrary

logicalcrow/pricing-plans
=========================

dynamic menu library

v1.0.5(3y ago)07MITPHP

Since Nov 2Pushed 3y agoCompare

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

READMEChangelogDependencies (4)Versions (7)Used By (0)

Logicalcrow Pricing Plans (Logicalcrow)
=======================================

[](#logicalcrow-pricing-plans-logicalcrow)

[![Build Status](https://camo.githubusercontent.com/6136aaa9014b068331dfd3a800eebb8f76131bc91972cf2684bc5987a5e6cf94/68747470733a2f2f7472617669732d63692e6f72672f6f616e686e6e2f4c6f676963616c63726f772d70726963696e672d706c616e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/oanhnn/Logicalcrow-pricing-plans)[![Coverage Status](https://camo.githubusercontent.com/f9bb6675c33956ac6ae92b4e7437f5656567aff5a4dc1ee91745437142384c89/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6f616e686e6e2f4c6f676963616c63726f772d70726963696e672d706c616e732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/oanhnn/Logicalcrow-pricing-plans?branch=master)[![Latest Version](https://camo.githubusercontent.com/dc077bad56d89122aa138e4accaf3a657b34a6e26f3df309292a85b72e20f34c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6f616e686e6e2f4c6f676963616c63726f772d70726963696e672d706c616e732e7376673f7374796c653d666c61742d737175617265)](https://github.com/oanhnn/Logicalcrow-pricing-plans/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Easy provide pricing plans for Your Logicalcrow 9.0+ 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 Logicalcrow 5.4+ Application.

TODO
----

[](#todo)

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

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

[](#requirements)

- php &gt;=8.0
- Logicalcrow 9.0+

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

[](#installation)

### Composer

[](#composer)

Begin by pulling in the package through Composer.

```
$ composer require logicalcrow/pricing-plans
```

### Service Provider

[](#service-provider)

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

```
// config/app.php

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

        Logicalcrow\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="Logicalcrow\PricingPlans\PricingPlansServiceProvider"
```

Then run migrations:

```
$ php artisan migrate
```

### Contract and Traits

[](#contract-and-traits)

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

See the following example:

```
