Subscriptionify: Laravel Subscription &amp; Feature Management | Mohamed Said       [Skip to content](#main)  [ ![](https://cdn.msaied.com/01KT78WE565VEMM3PSNQAAB0MH.png) Mohamed SaidLaravel Backend Engineer ](https://www.msaied.com/public) - [Home](https://www.msaied.com/public)
- [Projects](https://www.msaied.com/public/projects)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [About](https://www.msaied.com/public#about)

           [  Contact](https://www.msaied.com/public#contact) Menu 

Menu
----

Close 

 - [HomeStart here](https://www.msaied.com/public)
- [ProjectsCase studies](https://www.msaied.com/public/projects)
- [ArticlesEngineering notes](https://www.msaied.com/public/articles)
- [CertificatesCredentials](https://www.msaied.com/public/certificates)
- [AboutHow I work](https://www.msaied.com/public#about)
- [ContactGet in touch](https://www.msaied.com/public#contact)

  [Start a conversation](https://www.msaied.com/public#contact) [WhatsApp](https://wa.me/201094619204) [Email](mailto:hello@msaied.com) 

 1. [Home](https://www.msaied.com/public)
2. /
3. [Articles](https://www.msaied.com/public/articles)
4. /
5. [Laravel](https://www.msaied.com/public/articles?category=laravel)
6. /
7. Subscriptionify: Feature-Based Subscription Management for Laravel

   [Laravel](https://www.msaied.com/public/articles?category=laravel) [Composer Pacakge](https://www.msaied.com/public/articles?category=composer-pacakge) 

 Subscriptionify: Feature-Based Subscription Management for Laravel
===================================================================

 Subscriptionify is a gateway-agnostic Laravel package that models subscription plans, feature quotas, and usage tracking entirely in your own database — no payment provider lock-in required.

 ![](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp) [Mohamed Said](https://www.msaied.com/public#person) Published 15 Jun 2026 · Updated 15 Jun 2026 · 4 min read

ShareCopy linkCopied

 ![Subscriptionify: Feature-Based Subscription Management for Laravel](https://cdn.msaied.com/192/63268fabe13c0569d3c83b7d81cd6ac0.png) 

  On this page +1. [What Is Subscriptionify?](#what-is-subscriptionify)
2. [Installation](#installation)
3. [Making Any Model Subscribable](#making-any-model-subscribable)
4. [Four Feature Types for Different Quota Patterns](#four-feature-types-for-different-quota-patterns)
5. [Usage Tracking on the Subscribable Model](#usage-tracking-on-the-subscribable-model)
6. [Direct Grants Independent of the Plan](#direct-grants-independent-of-the-plan)
7. [Optional Overage and Metered Billing](#optional-overage-and-metered-billing)
8. [Route Middleware and Blade Directives](#route-middleware-and-blade-directives)
9. [Lifecycle, Events, and Scheduled Expiry](#lifecycle-events-and-scheduled-expiry)
10. [Key Takeaways](#key-takeaways)

 What Is Subscriptionify?
------------------------

[Subscriptionify](https://github.com/revoltify/subscriptionify) is a Laravel package by Rasel Islam Rafi that handles subscription plan modelling, feature quota enforcement, and usage tracking entirely within your own database. Unlike Laravel Cashier, it is completely payment-gateway-agnostic — it does not wrap any billing API. That makes it a practical choice when you bill through a provider Cashier does not support, charge against a prepaid balance, or need to gate features without charging at all.

It requires **PHP 8.2** and supports **Laravel 11, 12, and 13**.

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

```bash
composer require revoltify/subscriptionify
php artisan vendor:publish --tag=subscriptionify-config
php artisan vendor:publish --tag=subscriptionify-migrations
php artisan migrate

```

The migrations create six tables covering plans, features, the plan/feature pivot, subscriptions, usage records, and direct feature grants.

Making Any Model Subscribable
-----------------------------

Implement the `Subscribable` contract and add the `InteractsWithSubscriptions` trait to any Eloquent model — `User`, `Organisation`, `Workspace`, or whatever fits your domain:

```php
use Revoltify\Subscriptionify\Concerns\InteractsWithSubscriptions;
use Revoltify\Subscriptionify\Contracts\Subscribable;

class Workspace extends Model implements Subscribable
{
    use InteractsWithSubscriptions;
}

```

Four Feature Types for Different Quota Patterns
-----------------------------------------------

Subscriptionify distinguishes four feature types, each with its own consumption semantics:

- **Toggle** — a plain on/off capability gate.
- **Consumable** — a depletable quota that resets on a schedule (e.g. monthly API calls).
- **Limit** — a hard cap on a running total that can be freed again (e.g. active seats or projects).
- **Metered** — pay-per-use tracking with no cap, charging per unit.

Features are created once and attached to plans through a pivot that carries the allocation:

```php
$plan->features()->attach($reports, [
    'value'          => 500,          // 0 means unlimited
    'unit_price'     => '0.02000000',
    'reset_period'   => 1,
    'reset_interval' => 'month',
]);

```

Usage Tracking on the Subscribable Model
----------------------------------------

All consumption methods live directly on the subscribable model:

```php
$workspace->subscribe($plan);
$workspace->hasFeature('reports');       // feature available?
$workspace->canConsume('reports', 10);   // 10 units available?
$workspace->consume('reports', 10);      // record usage, throws on quota breach
$workspace->tryConsume('reports', 10);   // returns false instead of throwing
$workspace->remainingUsage('reports');   // units left this period

```

For `Limit` features, `release()` hands units back — essential for slot-based resources like projects or seats:

```php
$workspace->consume('projects', 1);  // create a project
$workspace->release('projects', 1);  // delete it, freeing the slot

```

Direct Grants Independent of the Plan
-------------------------------------

`grantFeature()` assigns quota directly to a subscribable on top of whatever the plan already provides. A plan with 500 reports plus a 1,000-unit grant yields 1,500 available units — useful for one-off top-ups or promotional bonuses without creating bespoke plans:

```php
$workspace->grantFeature('reports', value: 1_000);
$workspace->revokeFeature('reports'); // plan allocation still applies

```

Optional Overage and Metered Billing
------------------------------------

Billing is opt-in. Implement the `HasFunds` contract and the package charges overage against a balance you control. Amounts are passed as strings and compared with `bccomp`, so all arithmetic is arbitrary-precision rather than floating-point. Without `HasFunds`, features fall back to hard limits that throw on breach — meaning you can enforce quotas first and add billing later without rewriting consumption code.

Route Middleware and Blade Directives
-------------------------------------

Three middleware aliases protect routes and return `403` on failure:

```php
Route::middleware('subscribed')->group(...);
Route::middleware('plan:pro')->group(...);
Route::middleware('feature:reports')->group(...);

```

Matching Blade directives gate view content, including `@onTrial` and `@feature` blocks.

Lifecycle, Events, and Scheduled Expiry
---------------------------------------

Subscriptions support `changePlan()`, `renew()`, `cancel()`, `cancelNow()`, and `resume()`. Each transition dispatches an event (`SubscriptionCreated`, `SubscriptionCancelled`, `FeatureConsumed`, etc.). An Artisan command handles expiry:

```php
Schedule::command('subscriptionify:expire-overdue')->hourly();

```

Key Takeaways
-------------

- Gateway-agnostic: works with any payment provider or no provider at all.
- Four distinct feature types cover toggle, consumable, limit, and metered patterns.
- Direct grants let you top up individual subscribers without creating new plans.
- Billing via `HasFunds` is opt-in; quota enforcement works without it.
- Arbitrary-precision math (`bcmath`) prevents floating-point billing errors.
- Middleware and Blade directives provide first-class access gating.

---

*Source: [Laravel News — Subscriptionify: Feature-Based Subscription Management for Laravel](https://laravel-news.com/subscriptionify)*

- [Laravel](https://www.msaied.com/public/articles?search=Laravel)
- [Subscriptions](https://www.msaied.com/public/articles?search=Subscriptions)
- [Package](https://www.msaied.com/public/articles?search=Package)
- [SaaS](https://www.msaied.com/public/articles?search=SaaS)
- [Feature Flags](https://www.msaied.com/public/articles?search=Feature%20Flags)

 Frequently asked questions 
---------------------------

  How is Subscriptionify different from Laravel Cashier?Laravel Cashier wraps a specific payment provider's billing API (such as Stripe or Paddle). Subscriptionify is gateway-agnostic — it tracks plans, feature quotas, and usage in your own database and does not integrate with any payment provider directly, leaving billing to you.

   Can I enforce feature quotas without setting up billing?Yes. Billing via the HasFunds contract is entirely opt-in. Without it, Subscriptionify enforces hard quota limits that throw an exception when exceeded. You can add billing later without rewriting any of your consumption code.

   What is the difference between a Consumable and a Limit feature type?A Consumable is a depletable quota that resets on a schedule, such as a monthly allowance of API calls. A Limit is a hard cap on a running total that can be freed again — for example, active project slots where deleting a project calls release() to free the slot for reuse.

   ![Mohamed Said](https://cdn.msaied.com/01M22N44A70A5MC2S599JP0MPH.webp)About the author
----------------

[Mohamed Said](https://www.msaied.com/public#person)Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

[About](https://www.msaied.com/public#about) [GitHub ↗](https://github.com/EG-Mohamed) [LinkedIn ↗](https://www.linkedin.com/in/msaiedm/) [WhatsApp ↗](https://wa.me/201094619204) [Email Address ↗](mailto:hello@msaied.com) [My CV ↗](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)  

   [Previous articleCQRS Without Event Sourcing: Practical Command and Query Separation in Laravel](https://www.msaied.com/public/articles/cqrs-without-event-sourcing-practical-command-and-query-separation-in-laravel) [Next articleModular Monolith in Laravel: Enforcing Bounded Contexts Without a Framework](https://www.msaied.com/public/articles/modular-monolith-in-laravel-enforcing-bounded-contexts-without-a-framework)  

   On this page
-------------

1. [What Is Subscriptionify?](#what-is-subscriptionify)
2. [Installation](#installation)
3. [Making Any Model Subscribable](#making-any-model-subscribable)
4. [Four Feature Types for Different Quota Patterns](#four-feature-types-for-different-quota-patterns)
5. [Usage Tracking on the Subscribable Model](#usage-tracking-on-the-subscribable-model)
6. [Direct Grants Independent of the Plan](#direct-grants-independent-of-the-plan)
7. [Optional Overage and Metered Billing](#optional-overage-and-metered-billing)
8. [Route Middleware and Blade Directives](#route-middleware-and-blade-directives)
9. [Lifecycle, Events, and Scheduled Expiry](#lifecycle-events-and-scheduled-expiry)
10. [Key Takeaways](#key-takeaways)

 ###  Have a technical challenge?

 Tell me what you’re building. I reply within two working days.

[Start a conversation](https://www.msaied.com/public#contact) 

   Related articles
-----------------

 [ ![](https://cdn.msaied.com/740/cce86edc21eddcbdd2f2454fadaf9c70.png)  · 3 min read### The Pipeline Pattern in Laravel: Custom Pipelines Beyond Middleware

5 Oct 2026 ](https://www.msaied.com/public/articles/the-pipeline-pattern-in-laravel-custom-pipelines-beyond-middleware-1) [ ![](https://cdn.msaied.com/739/2d6897fdcdcf090613f96f72a64b8a78.png)  · 4 min read### MySQL Full-Text Search in Laravel: Indexes, Relevance Scoring, and Boolean Mode

4 Oct 2026 ](https://www.msaied.com/public/articles/mysql-full-text-search-in-laravel-indexes-relevance-scoring-and-boolean-mode) [ ![](https://cdn.msaied.com/738/073696a3fefe18bec825beec5ac658f5.png)  · 4 min read### Laravel Queue Rate-Limited Middleware: Throttling Jobs Without Losing Work

4 Oct 2026 ](https://www.msaied.com/public/articles/laravel-queue-rate-limited-middleware-throttling-jobs-without-losing-work) 

  Have a technical challenge?
----------------------------

Tell me what you’re building. I reply within two working days.

 [Discuss your project ↗](https://www.msaied.com/public#contact) 

  © 2026 Mohamed Said · Built with Laravel, meant to last.Senior Backend Engineer specializing in Laravel, scalable SaaS platforms, APIs, and cloud infrastructure. I build secure, high-performance web applications that help businesses grow.

 - [Home](https://www.msaied.com/public)
- [Articles](https://www.msaied.com/public/articles)
- [Certificates](https://www.msaied.com/public/certificates)
- [GitHub](https://github.com/EG-Mohamed)
- [LinkedIn](https://www.linkedin.com/in/msaiedm/)
- [WhatsApp](https://wa.me/201094619204)
- [Email Address](mailto:hello@msaied.com)
- [My CV](https://drive.google.com/file/u/0/d/1MF20IPRJyzfy32mhEutjL5EpSls0w2Q8/view)
- [Sitemap](https://www.msaied.com/public/sitemap.xml)
