PHPackages                             salehye/subscription-core - 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. salehye/subscription-core

ActiveLibrary[Payment Processing](/categories/payments)

salehye/subscription-core
=========================

A powerful, extensible subscription management package for Laravel. Manage plans, features, subscriptions, and usage tracking with multi-tenancy support.

v1.1.1(1mo ago)017MITPHPPHP ^8.3

Since Jun 15Pushed 1mo agoCompare

[ Source](https://github.com/salehye/subscription-core)[ Packagist](https://packagist.org/packages/salehye/subscription-core)[ Docs](https://github.com/salehye/subscription-core)[ RSS](/packages/salehye-subscription-core/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (8)Versions (5)Used By (0)

Subscription Core
=================

[](#subscription-core)

[![Latest Version](https://camo.githubusercontent.com/0d5c39481179f2bb368f16b402199cdd65bbfedb4559a655a227b56261f503d6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f73616c656879652f737562736372697074696f6e2d636f7265)](https://github.com/salehye/subscription-core/releases)[![PHP](https://camo.githubusercontent.com/d3b570e3ab8271487714a76fdcaee4b119c41b1d0e8b9172d23bb96118c69baf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253545382e332d373737424234)](https://php.net)[![Laravel](https://camo.githubusercontent.com/23c642fce3ee4d62af93109db2cbe9a8300b244604610aee710c6cd053045ded/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d25354531312e3025374325354531322e302d464632443230)](https://laravel.com)[![License](https://camo.githubusercontent.com/88e1dabf4d223df0950e0985948e231325fefca9fa7fe9e446cf8b1c5e9d9e47/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e)](LICENSE)

A powerful, extensible subscription management package for Laravel. Manage plans, features, subscriptions, and usage tracking with multi-tenancy support — no external payment gateway required.

Features
--------

[](#features)

- ✅ **Plan Management** — Create and manage subscription plans with different billing cycles
- ✅ **Feature System** — Toggle, consumable, and limit feature types
- ✅ **Subscription Management** — Subscribe, cancel, renew, pause/resume, switch plans
- ✅ **Add-on Support** — Attach add-on subscriptions to primary subscriptions
- ✅ **Usage Tracking** — Track consumable feature usage with automatic limit enforcement
- ✅ **Feature Aggregation** — Automatically aggregates feature values from primary + add-on plans
- ✅ **Multi-Tenancy** — Optional tenant scoping for SaaS applications
- ✅ **Event System** — Rich events for all subscription lifecycle changes
- ✅ **Artisan Commands** — Expire subscriptions, reset usage, generate recurring invoices
- ✅ **Middleware** — Protect routes based on feature access
- ✅ **Polymorphic** — Works with any model (User, Team, Organization, etc.)
- ✅ **Extensible** — Replace any component via contracts/interfaces
- ✅ **No Payment Gateway** — Pure subscription logic, ready to integrate with any payment system

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

[](#requirements)

- PHP ^8.3
- Laravel ^11.0|^12.0
- MySQL / PostgreSQL / SQLite

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

[](#installation)

```
composer require salehye/subscription-core
```

### Publish Configuration &amp; Migrations

[](#publish-configuration--migrations)

```
# Publish config
php artisan vendor:publish --tag=subscription-config

# Publish migrations
php artisan vendor:publish --tag=subscription-migrations

# Run migrations
php artisan migrate
```

### Quick Start with Seeders

[](#quick-start-with-seeders)

```
php artisan db:seed --class="Salehye\Subscription\Database\Seeders\PlanSeeder"
php artisan db:seed --class="Salehye\Subscription\Database\Seeders\FeatureSeeder"
```

Usage
-----

[](#usage)

### 1. Prepare Your Model

[](#1-prepare-your-model)

Add the `HasSubscriptions` trait to any model:

```
