PHPackages                             codeforest/plan-config - 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. codeforest/plan-config

ActiveLibrary

codeforest/plan-config
======================

Plan config allows you to easily define attributes and limits for your SaaS application subscription plans.

1.2.0(9y ago)142MITPHPPHP &gt;=5.5.9

Since May 23Pushed 8y ago4 watchersCompare

[ Source](https://github.com/codeforest/Plan-Config)[ Packagist](https://packagist.org/packages/codeforest/plan-config)[ Docs](https://github.com/theseanstewart/Plan-Config)[ RSS](/packages/codeforest-plan-config/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Plan Config
===========

[](#plan-config)

This Laravel 5 package makes it easy to manage the rules/limits of your SaaS app subscription plans.

How to install
--------------

[](#how-to-install)

Pull the package in through Composer.

```
"require": {
    "seanstewart/plan-config": "dev-master"
}
```

Include the service provider within `app/config/app.php`.

```
'providers' => [
    Seanstewart\PlanConfig\PlanConfigServiceProvider::class
];
```

Include the facade (optional) in `app/config/app.php`.

```
'aliases' => [
    'Plan'       => Seanstewart\PlanConfig\Plan::class
];
```

Then you will need to generate your config by running the command

```
php artisan vendor:publish
```

How to Use
----------

[](#how-to-use)

Let's say your app has subscription plans that limit the number of widgets a user can add. You would have some sort of logic that checks the number of widgets a user is allowed to have in their account. With Plan Config you can do that by calling the helper function plan().

```
if($this->getCurrentNumberOfWidgets < plan('limits.widgets'))
{
    // Allow the user to add a new widget
}
```

The plan() helper function knows what plan the current user is subscribed to and grabs the limits you defined in your plans.php config file. You can use the helper function anywhere in your application (views, controllers, models, middleware, etc.). Using the previous example, your plan config file would look like this:

```
'plans' => [

    'bronze'   => [
        'limits' => [
            'widgets' => 5
        ]
    ],

    'silver'   => [
        'limits' => [
            'widgets' => 10
        ]
    ],

    //...and so on

]
```

If your user is subscribed to the silver plan, they could only add 10 widgets. You can even adapt it to use other attributes, like a title, description, or pricing for your plans.

```
'plans' => [

    'bronze' => [
        'title'       => 'Bronze Plan',
        'description' => 'This is some description for a Bronze Plan',
        'price'       => '19.00',
        'currency'    => 'USD',
        'limits'      => [
            'widgets' => 5
        ]
    ],

    'silver' => [
        'title'       => 'Silver Plan',
        'description' => 'This is some description for the Silver Plan',
        'price'       => '29.00',
        'currency'    => 'USD',
        'limits'      => [
            'widgets' => 10
        ]
    ],

    //...and so on

]
```

Configuring Your Plans
======================

[](#configuring-your-plans)

To configure your plans, open up app/plans.php and start adding your plan details. By default the package assumes that you're using laravel's built in Auth, and that the user's plan is stored in the User model. You can set the field used to determine the user's plan in the config...

```
'plan_field' => 'stripe_plan'
```

To configure your plans, add your plan data in the 'plans' array.

```
'plans' => [

    'bronze'   => [
        'limits' => [
            'widgets' => 5
        ]
    ],

    'silver'   => [
        'limits' => [
            'widgets' => 10
        ]
    ],

    //...and so on

]
```

If you have rules that apply to all plays, you can define a default or fallback plan. In the config file, set your fallback plan...

```
'fallback_plan' => '_default',
```

And then define the \_default plan in your plans array.

```
'plans' => [

    '_default' => [
        'limits' => [
            'purple_widgets' => 20
        ]
    ]

    'bronze'   => [
        'limits' => [
            'widgets' => 5
        ]
    ],

    'silver'   => [
        'limits' => [
            'widgets' => 10
        ]
    ],

]
```

In the above example, calling plan('limits.purple\_widgets') will give you the value from the fallback plan.

Alternatively you can use the facade and call Plan::get('limits.purple\_widgets')

Why I created this
==================

[](#why-i-created-this)

I've always found that managing subscriptions and plans for a SaaS app can be complicated. I felt like storing these values in a database isn't the best approach considering a lot of your values and limits will not change frequently. When building [Election Runner](https://electionrunner.com), a web application that allows schools &amp; organizations to run elections, we needed something to accomplish exactly this. Hopefully others will find this as useful as we do!

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3643d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/baa69fb282a058d95e803e4640d064ebf37075850879fd3fa6f68c97c5fcd08d?d=identicon)[codeforest](/maintainers/codeforest)

---

Top Contributors

[![codeforest](https://avatars.githubusercontent.com/u/1256030?v=4)](https://github.com/codeforest "codeforest (5 commits)")[![theseanstewart](https://avatars.githubusercontent.com/u/2438547?v=4)](https://github.com/theseanstewart "theseanstewart (5 commits)")[![alariva](https://avatars.githubusercontent.com/u/3021314?v=4)](https://github.com/alariva "alariva (2 commits)")

---

Tags

laravelconfiglaravel5saasplanssubscription plans

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codeforest-plan-config/health.svg)

```
[![Health](https://phpackages.com/badges/codeforest-plan-config/health.svg)](https://phpackages.com/packages/codeforest-plan-config)
```

###  Alternatives

[seanstewart/plan-config

Plan config allows you to easily define attributes and limits for your SaaS application subscription plans.

314.0k](/packages/seanstewart-plan-config)[andrewdwallo/filament-companies

A comprehensive Laravel authentication and authorization system designed for Filament, focusing on multi-tenant company management.

34450.0k2](/packages/andrewdwallo-filament-companies)[illuminatech/config

Provides support for Laravel application runtime configuration managed in persistent storage

14921.0k1](/packages/illuminatech-config)[illuminatech/array-factory

Allows DI aware object creation from array definition

2159.6k6](/packages/illuminatech-array-factory)[creatydev/plans

Laravel Plans is a package for SaaS apps that need management over plans, features, subscriptions, events for plans or limited, countable features.

421.2k](/packages/creatydev-plans)[dolphiq/laravel-aescrypt

AES encrypt and decrypt Eloquent attributes inspired by elocryptfive

171.7k](/packages/dolphiq-laravel-aescrypt)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
