Class-Based Features
Instead of referencing feature keys as magic strings like'exports' or 'projects', you can define feature classes for type safety, IDE autocompletion, and safe refactoring.
Creating a feature class
ImplementPixelworxio\Subscribd\Contracts\Feature:
Checking with a feature class
Pass the class or an instance directly toallows() and limit():
Feature class with a default limit
Define a default limit on the class itself. When the plan does not specify a value for the feature, this default is used as a fallback:Organising feature classes
A simple approach is aApp\Features\ namespace with one class per feature:
Next steps
- Checking Features — String-based feature checks
- Limits and Usage — Tracking usage against limits