Overview
Feature flags are stored in the database and can be toggled at runtime. Users with theBYPASS_FEATURE_FLAGS permission can always access all features regardless of flag state.
Available Feature Flags
The following feature flags are available in AnimeThemes Server:AllowVideoStreams
Controls whether video streaming is enabled. Location:app/Features/AllowVideoStreams.php
AllowAudioStreams
Controls whether audio streaming is enabled. Location:app/Features/AllowAudioStreams.php
AllowSubmission
Controls whether users can submit new content (anime, themes, etc.). Location:app/Features/AllowSubmission.php
AllowPlaylistManagement
Controls whether users can create and manage playlists. Location:app/Features/AllowPlaylistManagement.php
AllowExternalProfileManagement
Controls whether users can link and manage external profiles (MyAnimeList, AniList, etc.). Location:app/Features/AllowExternalProfileManagement.php
AllowDumpDownloading
Controls whether database dump downloads are available. Location:app/Features/AllowDumpDownloading.php
AllowScriptDownloading
Controls whether video encoding script downloads are available. Location:app/Features/AllowScriptDownloading.php
Configuration
Feature flags are configured inconfig/pennant.php:
Environment Variables
| Variable | Default | Description |
|---|---|---|
PENNANT_STORE | database | Feature flag store: database or array |
Managing Feature Flags
Enable a Feature
Disable a Feature
Check Feature Status
Clear Feature Cache
Database Structure
Feature flags are stored in thefeatures table:
Using Feature Flags in Code
In Controllers
In Middleware
In Blade Templates
For Specific Users
All feature flags in AnimeThemes check if the user has theBYPASS_FEATURE_FLAGS permission:
Creating New Feature Flags
To create a new feature flag:- Create a new class in
app/Features/:
- Use the feature flag in your code:
- Activate the feature:
Best Practices
Use feature flags for gradual rollouts
Use feature flags for gradual rollouts
Enable new features for a subset of users or environments before rolling out to everyone.
Grant bypass permissions carefully
Grant bypass permissions carefully
The
BYPASS_FEATURE_FLAGS permission allows users to access all features. Only grant this to trusted administrators.Clean up old feature flags
Clean up old feature flags
Once a feature is fully rolled out and stable, remove the feature flag to reduce technical debt.
Document feature flag states
Document feature flag states
Keep track of which features are enabled in which environments (production, staging, development).
Troubleshooting
Feature flag changes not taking effect
Clear the feature cache:Cannot access features table
Ensure the database migration has run:Feature always enabled/disabled
Check if the user has theBYPASS_FEATURE_FLAGS permission, which overrides all feature flag checks.
Next Steps
Environment Variables
Configure environment variables
REST API
Explore the REST API
Storage Configuration
Set up file storage
Authentication
Manage users and permissions