Download the PHP package salehye/subscription-core without Composer
On this page you can find all versions of the php package salehye/subscription-core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download salehye/subscription-core
More information about salehye/subscription-core
Files in salehye/subscription-core
Download salehye/subscription-core
More information about salehye/subscription-core
Files in salehye/subscription-core
Vendor salehye
Package subscription-core
Short Description A powerful, extensible subscription management package for Laravel. Manage plans, features, subscriptions, and usage tracking with multi-tenancy support.
License MIT
Homepage https://github.com/salehye/subscription-core
Package subscription-core
Short Description A powerful, extensible subscription management package for Laravel. Manage plans, features, subscriptions, and usage tracking with multi-tenancy support.
License MIT
Homepage https://github.com/salehye/subscription-core
Please rate this library. Is it a good library?
Informations about the package subscription-core
Subscription Core
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
- ✅ 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
- PHP ^8.3
- Laravel ^11.0|^12.0
- MySQL / PostgreSQL / SQLite
Installation
Publish Configuration & Migrations
Quick Start with Seeders
Usage
1. Prepare Your Model
Add the HasSubscriptions trait to any model:
2. Create Plans & Features
3. Subscribe a User
4. Manage Subscriptions
5. Check Feature Access
6. Using the FeatureGuard Service
7. Route Middleware
Protect routes based on feature access:
8. Artisan Commands
Feature Types
| Type | Description | Example Value |
|---|---|---|
toggle |
On/off feature access | true, false |
consumable |
Usage-based with tracking | 100, unlimited |
limit |
Dynamic check (count existing records) | 10, unlimited |
Events
| Event | Description |
|---|---|
SubscriptionStarted |
Dispatched when a subscription is created or renewed |
SubscriptionRenewed |
Dispatched when a subscription is renewed |
SubscriptionCancelled |
Dispatched when a subscription is cancelled |
PlanChanged |
Dispatched when a subscription switches plans |
FeatureConsumed |
Dispatched when a consumable feature is used |
FeatureLimitReached |
Dispatched when a feature limit is reached |
SubscriptionExpired |
Dispatched when a subscription expires |
Architecture
Customization
Replace the Feature Resolver
Create a custom resolver:
Then update config/subscription.php:
Replace the Plan Repository
Multi-Tenancy
Enable multi-tenancy in config/subscription.php:
Testing
License
The MIT License (MIT). See LICENSE for more information.
Credits
All versions of subscription-core with dependencies
PHP Build Version
Package Version
The package salehye/subscription-core contains the following files
Loading the files please wait ...