bytebeez / laravel-subscription-core
Package info
github.com/talukdaranjan/laravel-subscription-core
pkg:composer/bytebeez/laravel-subscription-core
Requires
- php: ^8.2
- illuminate/database: ^10|^11|^12
- illuminate/filesystem: ^10|^11|^12
- illuminate/support: ^10|^11|^12
README
A feature-based SaaS subscription engine for Laravel.
Laravel Subscription Core provides a flexible, usage-aware subscription system designed for modern multi-tenant SaaS applications. It enables you to define plans, attach feature limits, track usage, and manage subscription lifecycle without locking you into any specific billing provider.
🚀 Features
- Feature-based plan limits
- Usage tracking & metering
- Trial support
- Grace period support
- Plan switching
- Subscription renewal & cancellation
- Resettable usage windows (daily / monthly)
- Multi-tenant ready
- Billing provider independent (Stripe, Razorpay, etc.)
📦 Installation
Install via Composer:
composer require bytebeez/laravel-subscription-core
Laravel will automatically discover the package.
⚙️ Publish Assets
Publish configuration file:
php artisan vendor:publish --tag=subscription-config
Publish migrations:
php artisan vendor:publish --tag=subscription-migrations
Run migrations:
php artisan migrate
🧠 Core Concepts
Plans
Define pricing structure and billing cycle.
Features
Attach limits or toggles to plans such as:
- Number of users
- Appointments
- API usage
- Storage
- Enabled modules
Subscriptions
Assigned to an organization and linked to a plan.
Usage Tracking
Automatically records consumption of feature limits.
🏗️ Example Usage
Check if an organization can use a feature:
app('subscription-core')->canUse($organization, 'appointments');
Record usage:
app('subscription-core')->record($organization, 'appointments');
🔌 Billing Ready
This package does NOT enforce any payment gateway.
You can integrate:
- Stripe
- Razorpay
- PayPal
- Offline billing
without modifying core subscription logic.
🏢 Multi-Tenant Support
The package is designed to work with organization-based SaaS systems.
You can configure your tenant model in:
config/subscription.php
🧩 Use Cases
- SaaS ERP systems
- Healthcare platforms
- Queue management apps
- AI tools
- EdTech platforms
- Marketplaces
🛠️ Compatibility
Supports:
- Laravel 10
- Laravel 11
- Laravel 12
📜 License
MIT License