Download the PHP package zenmanage/zenmanage-laravel without Composer

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

Zenmanage Laravel SDK

Build Status Codacy Badge

Add feature flags to your Laravel application in minutes. Control feature rollouts, A/B test, and manage configurations without deploying code.

Why Zenmanage?

Installation

Requirements: Laravel 11+, PHP 8.1+

Key Compatibility

The service provider will be auto-discovered. If you need to manually publish the config:

Get Started in 60 Seconds

  1. Get your server key (srv_...) from zenmanage.com
  2. Set your token in .env:

  3. Check a feature flag:

That's it! ๐ŸŽ‰

Configuration

The only required configuration is the Environment Token (server key prefixed with srv_). Configuration values are set in config/zenmanage.php:

The SDK client metadata is set automatically and is not configurable via environment:

Common Use Cases

Roll Out a Feature Gradually

A/B Testing

Percentage Rollouts

Gradually roll out features to a percentage of your users. The SDK handles bucketing automatically using a deterministic CRC32B hash โ€” no manual bucket logic needed.

How it works:

Note: A context identifier is required for bucketing. Without one, the user always receives the fallback value.

Feature Toggles by Organization

Configuration Values

Kill Switch for Problem Features

Working with Contexts

Contexts let you target flags to specific users, organizations, or any custom attributes. This is how you do gradual rollouts, A/B tests, and targeted features.

Simple Context (One Attribute)

Rich Context (Multiple Attributes)

What you get:

When to use contexts:

Safe Defaults - Never Break Your App

Always provide defaults for critical features. The SDK will use them if:

Inline Defaults (Recommended)

Default Collections (For Multiple Flags)

Priority Order

When retrieving a flag, the SDK checks in this order:

  1. API Value - If flag exists in Zenmanage
  2. Inline Default - Value passed to single('flag', default)
  3. Collection Default - From DefaultsCollection
  4. Exception - If none of the above

Retrieving Feature Flags

Using the Facade (Recommended)

Using Dependency Injection

Getting Flag Values

All Flags

Single Flag

Reporting Feature Flag Usage

When your application uses a feature flag, it can notify Zenmanage of the usage. This helps Zenmanage determine which flags are active and which may have been abandoned. Note that single() automatically reports usage, so you typically don't need to call this manually.

Refreshing Rules

You can manually refresh the flag rules from the API:

Webhooks

Instead of waiting for cache_ttl to lapse, the package can register a webhook endpoint that a Zenmanage environment webhook calls to immediately refresh cached flag rules. This is disabled by default โ€” you opt in with a config flag:

When webhook.enabled is true, the package registers POST /zenmanage/webhook (customize the path with webhook.path / ZENMANAGE_WEBHOOK_PATH). Requests are rejected with a 401 unless they carry a valid X-Zenmanage-Signature header, verified against webhook.secret โ€” so webhook.secret must be set for the endpoint to accept any requests.

To wire it up:

  1. Publish the config if you haven't already: php artisan vendor:publish --tag=config.
  2. Set ZENMANAGE_WEBHOOK_ENABLED=true and ZENMANAGE_WEBHOOK_SECRET in your .env.
  3. In your Zenmanage dashboard, create an environment webhook pointing at https://your-app.com/zenmanage/webhook, and copy its signing secret (prefixed whsec_) into ZENMANAGE_WEBHOOK_SECRET.

On every verified request, the endpoint calls the same refreshRules() used above, so your app picks up flag changes immediately instead of on the next cache expiry.

Note: The webhook route is registered on its own, outside routes/web.php, so it isn't part of Laravel's web middleware group (and its CSRF protection) by default. If your application applies CSRF verification globally, exclude the webhook path explicitly:

Testing

Mock the Zenmanage facade in your tests:

Or use ::fake() to disable actual API calls:

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/zenmanage/zenmanage-laravel. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The library is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Zenmanage's code bases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

What is Zenmanage?

Zenmanage allows you to control which features and settings are enabled in your application giving you better flexibility to deploy code and release features.

Zenmanage was started in 2024 as an alternative to highly complex feature flag tools. Learn more about us.


All versions of zenmanage-laravel with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
zenmanage/zenmanage-php Version ^5.1.3
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 zenmanage/zenmanage-laravel contains the following files

Loading the files please wait ...