Download the PHP package al_imran/runtime-feature-toggle without Composer

On this page you can find all versions of the php package al_imran/runtime-feature-toggle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package runtime-feature-toggle

๏ปฟ# Runtime Feature Toggle

Latest Version on Packagist Total Downloads License

Runtime Feature Toggle is a high-performance, decoupled feature flag engine for Laravel. It allows you to dynamically control application behavior and configuration at runtime without code deployments or configuration changes.

Instant Control, Zero Deployment

Imagine you need to pause all outgoing emails or SMS notifications during a maintenance window. Normally, you'd have to update an .env key or change your code and redeploy to production.

With Runtime Feature Toggle, you can toggle these features instantly via the database. The best part? Our intelligent caching system ensures that these checks are lightning-fast, giving you the power of dynamic control with the performance of local configuration.


Why Use This Package?

In modern software development, decoupling feature releases from code deployments is critical. This package solves several common problems:

Key Features


Installation

You can install the package via composer:

Setup

Run the installation command to publish the configuration, migrations, and assets:

This command will:

  1. Publish the config/feature.php file.
  2. Publish and run the database migrations.
  3. Prepare the package for use.

Feature Management

This package comes with a built-in dashboard to add, edit, and maintain your feature flags without touching the database manually.

Accessing the Dashboard

By default, the dashboard is available at: YOUR_APP_URL/features-manager

From here, you can:

Customizing & Securing the Dashboard

By default, the management dashboard is accessible at /features-manager. While this is convenient for development, you should secure it in production environments.

Option 1: Using Configuration (Easiest)

The simplest way to protect the dashboard is by updating the config/feature.php file. You can add any middleware (like auth or custom admin middleware) to the routes array:

Option 2: Taking Full Ownership of Routes

If you need even more control (e.g., adding extra routes or changing the route structure), you can publish the routes file to your application:

This will create routes/runtimeFeature.php in your project. The package will automatically detect and use this file instead of its internal routes. You can then modify the group directly:

[!IMPORTANT] Security Reminder: The developer is responsible for ensuring that the dashboard routes are properly protected. By default, only the web middleware is applied, which provides no authentication or authorization.


Basic Usage

1. Simple On/Off Checks (enabled)

Use this to check if a feature is active.

2. Retrieving Dynamic Values (value)

Fetch dynamic configurations stored with your feature flag.

Method Returns Description
enabled() bool Is the feature active?
value() mixed Returns the dynamic JSON payload or a default.

Advanced Usage

Contextual Evaluation

Pass a context (e.g., a User model) to evaluate rules specifically for that entity.

Custom Conditions

Register your own logic for rule evaluation.

Mocking for Tests

Avoid database hits in your tests by faking feature states.


Real-World Use Cases

  1. Feature Rollout: Enable new_sidebar for 10% of users to monitor performance before a full launch.
  2. A/B Testing: Store different configuration values (e.g., button colors) in the value field to test user engagement.
  3. Emergency Toggles: If a 3rd-party service goes down, instantly disable the integration via the dashboard to keep the rest of the app running.

Comparison: Laravel Pennant

While Laravel Pennant is an excellent tool for user-centric feature flags, Runtime Feature Toggle differs in its focus:


Testing

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.


Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.


Packagist Description: A high-performance, decoupled feature flag engine with a management UI and dynamic JSON configuration support for Laravel.

Keywords: laravel, feature-flags, remote-config, feature-toggle, runtime-configuration


All versions of runtime-feature-toggle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/cache Version ^10.0|^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package al_imran/runtime-feature-toggle contains the following files

Loading the files please wait ...