Download the PHP package michael-lurquin/feature-limiter without Composer
On this page you can find all versions of the php package michael-lurquin/feature-limiter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download michael-lurquin/feature-limiter
More information about michael-lurquin/feature-limiter
Files in michael-lurquin/feature-limiter
Package feature-limiter
Short Description A Laravel package to manage SaaS features, quotas and usage. Supports boolean features, numeric limits, storage, unlimited plans and period-based usage. Built for modern multi-tenant SaaS and flexible billing systems.
License MIT
Homepage https://github.com/michael-lurquin/feature-limiter
Informations about the package feature-limiter
Feature Limiter for Laravel
A flexible plan / feature / quota / usage system for Laravel applications, with built-in helpers for pricing pages (cards & comparison tables).
Supports:
- Plan & Feature management
- Quotas per plan
- Usage tracking per billable (User, Tenant, Team, etc.)
- Unlimited features
- Storage units (e.g.
500MB,1GB) - Period-based resets (daily, weekly, monthly, yearly, lifetime)
- Transaction-safe consumption
- Pluggable billing providers (Cashier, manual, fake, etc.)
- Pricing catalog generation (cards & comparison tables)
Installation
Publish the config and run migrations:
Concepts
| Term | Meaning |
|---|---|
| Plan | A subscription plan (e.g. Starter, Pro) |
| Feature | A capability (sites, storage, custom_code, etc.) |
| Quota | The limit defined by the plan |
| Usage | How much a billable has consumed |
| Billable | Any model or object with an id |
| Reset period | When usage is reset (none, daily, weekly, monthly, yearly) |
Creating Plans
Short version:
Multiple plans:
Sort version:
Creating Features
Short version:
Supported feature types:
FeatureType::INTEGERFeatureType::BOOLEANFeatureType::STORAGE
Multiple features:
Short version:
Assigning Features to a Plan (Quotas)
Integer quota
Boolean features
Unlimited features
Alternative unlimited values:
Assign Multiple Features at Once
Unlimited:
Reading Plan Quotas
Reading Quotas for a Billable
Usage (Consumption Tracking)
Consuming quota (non-strict)
Consuming quota (strict)
Convenience aliases
Refund / rollback usage
Quota vs Usage
Check if a billable can still consume quota:
Remaining quota:
Exceeded quota:
Multiple features at once:
Storage Units
Supported formats:
Billing Providers
You can implement your own provider:
Billable Objects
A billable can be:
- An Eloquent model
- Any object with an
idproperty
Reset Periods
Each feature can define how often its usage resets:
Usage is automatically grouped per period in the database.
Catalog (Pricing UI)
FeatureLimiter can generate ready-to-render structures for your pricing pages.
Pricing cards (featured features)
Full comparaison table (grouped)
The returned structure contains plan headers + grouped feature rows (by feature.group), perfect for building a pricing comparison table.
Pricing (optional)
FeatureLimiter can optionally fetch and expose plan prices through a billing provider (e.g. Stripe via Cashier).
1) Catalog output (cards / comparison table)
By default, catalogs do not include prices (no external provider calls):
If you want prices, explicitly enable them:
2) Single plan
By default, viewPlan() returns the plan reader without prices:
To fetch prices for a specific plan:
3) Billable plan
By default, resolving the billable plan does not fetch prices:
To fetch prices for the resolved plan:
Pruning Old Feature Usages
Over time, the fl_feature_usages table can grow significantly.
FeatureLimiter provides a built-in Artisan command to clean up old usage records while keeping recent data for analytics, reporting, and charts.
Basic usage
Remove all usage records older than 12 months:
Remove all usage records older than 90 days (dry run – no deletion):
Optional flags
| Option | Description |
|---|---|
--days=90 |
Keep only the last 90 days of usage |
--months=12 |
Keep only the last 12 months of usage |
--years=2 |
Keep only the last 2 years of usage |
--dry-run |
Show what would be deleted without deleting |
--prune-zero |
Also remove rows where used = 0 |
Scheduler example
Why keep historical usages?
FeatureLimiter stores all usage records by default so you can:
- Build usage charts
- Generate reports
- Track growth over time
- Audit consumption behavior
The pruning command gives you full control over how much history you keep.
License
MIT
Contributing
See CONTRIBUTING.md.
All versions of feature-limiter with dependencies
illuminate/support Version ^10.0 || ^11.0 || ^12.0
illuminate/database Version ^10.0 || ^11.0 || ^12.0
stripe/stripe-php Version ^16.2 || ^17.3 || ^18.0 || ^19.0