- How do I install lacodix/laravel-plans in a Laravel application?
- Install it with composer require lacodix/laravel-plans; the service provider is auto-discovered. Publish and run the package migrations, then add the HasSubscriptions trait to the model that should own subscriptions, such as User, Tenant, or Team. No external services, SDKs, or credentials are required.
- Does laravel-plans handle billing, invoices, and payments?
- No. The package deliberately excludes invoicing, payment capture, and tax, so it is an entitlement layer rather than a billing engine. Use it beneath Stripe, Laravel Cashier, Paddle, or another invoice provider. Events such as SubscriptionRenewed give you a seam to create invoices or sync payment state in a listener.
- Can a user subscribe to multiple plans or addons at the same time?
- Yes. Subscriptions are modeled by slug, so a subscriber can hold a main plan plus addons with different billing intervals. Plan and subscription ordering controls how countable feature usage is consumed across plans. Credit exhaustion can flow from the primary plan into addon buckets, which is the package's main differentiator.
- How do countable and uncountable features work in laravel-plans?
- Uncountable features act as on/off toggles for functionality, while countable features represent credits, tokens, or similar quotas. Each plan can attach a different feature value, including unlimited, and countable values can auto-reset after configured intervals. Consumption splits usage across plans according to their order.
- Is feature consumption atomic and safe under concurrent requests?
- The documentation does not explicitly guarantee row locking or atomic decrements, so treat concurrent credit spending as a risk to verify. If consumption is read-modify-write across rows, concurrent requests could double-spend credits without transactions and locks. Inspect the source or run a spike using lockForUpdate or atomic updates before relying on it in production.
- How are subscription renewals and feature resets triggered?
- The docs do not describe an opinionated scheduler, so resets and renewals appear caller-driven. You will likely need to schedule the relevant commands or jobs and confirm they are idempotent under retry. Owning that scheduler and queue operation is part of adopting the package.
- Which Laravel and PHP versions does lacodix/laravel-plans support?
- The package targets modern Laravel and PHP, commonly assumed to be Laravel 10+ and PHP 8.1+, but verify the exact matrix in composer.json and the CI test workflow. It is database-agnostic Eloquent, so MySQL and PostgreSQL are both reasonable. It also composes with Spatie packages such as laravel-translatable and eloquent-sortable.
- Can I use laravel-plans alongside Laravel Cashier?
- You can, but both packages model subscriptions, and Cashier ships its own subscriptions table, so table and migration collisions are a real risk. Make an explicit decision that laravel-plans is the source of truth for entitlements while Cashier owns payment state, or avoid running both. Check migration naming and ordering carefully to prevent accidental coupling.
- How should I handle plan changes or grandfathered pricing when editing a plan?
- The package does not appear to provide plan versioning, so editing a plan's price or feature values may retroactively affect existing subscribers. Handle grandfathering by cloning plans, using meta data, or building your own versioning layer. Validate period math, proration, trial boundaries, month lengths, and DST behavior against known billing cases rather than trusting defaults.
- Is lacodix/laravel-plans production-ready and what are the alternatives?
- It is a 1.x package with a single maintainer, roughly 7 GitHub stars, and no visible production user base, so treat it as a bus-factor-one dependency. The repository advertises tests, PHPStan, and code-style tooling, but confirm those checks are enforced in CI rather than aspirational. Alternatives include building entitlement logic in-house or using Laravel Cashier for payment state with a separate entitlement layer, since there is no drop-in equivalent with the same credit-splitting model. Budget for building your own admin UI and CRUD because the package ships no HTTP layer.