Download the PHP package offload-project/laravel-toggle without Composer

On this page you can find all versions of the php package offload-project/laravel-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 laravel-toggle

Laravel Toggle

Latest Version on Packagist Tests Build Total Downloads

A simple and flexible feature toggle (feature flag) package for Laravel. Control feature rollouts with config-based flags, database-driven toggles, or both.

Features

Table of Contents

Why Laravel Toggle?

Laravel's first-party Pennant package is designed for user-segmented rollouts and A/B testing. Laravel Toggle is simpler — it's for global on/off switches controlled by environment variables or database records, with no user resolution or driver complexity.

Requirements

Installation

If using the database driver, publish and run the migrations:

Quick Start

Define a toggle in config

Add your feature flags to config/toggle.php:

Check toggles in code

Use Blade directives

Configuration

Driver

Set the driver in your .env file:

The config driver is read-only at runtime — values come from environment variables and config files.

The database driver checks the database first, then falls back to config values. This allows you to define defaults in config while overriding specific toggles at runtime.

Per-flag driver routing

You can mix both drivers in the same application. Define config-driven flags in flags and list database-driven flags in database_flags:

Resolution logic:

This lets you keep stable flags in .env while allowing runtime control over flags that need to change without a deploy.

Default behavior for undefined toggles

Caching

Usage

Facade methods

Using enums

Define your toggles as a backed enum for type safety:

Use the enum directly:

Eloquent model

When using the database driver, you can also use the Toggle model directly:

The model automatically clears the cache when toggles are saved or deleted.

Inertia

Share all toggles with your frontend by using the provided Inertia middleware. Replace your HandleInertiaRequests middleware in bootstrap/app.php:

All toggles will be available as the flags prop in your frontend:

Artisan Commands

List all toggles

Displays a table of all defined toggles and their current state.

Create a toggle

This command will:

Clear cache

AI Coding Assistant Skill

This package ships a Laravel Boost skill so coding assistants (Claude Code, Cursor, etc.) follow the package's conventions when generating code. Install it in your app with:

The skill source lives at skills/SKILL.md.

Testing

Contributing

Contributions are welcome! Please see the documents below before getting started.

Security

License

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


All versions of laravel-toggle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/support Version ^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 offload-project/laravel-toggle contains the following files

Loading the files please wait ...