Home / Developers / Laravel

Quickstart by stack

Laravel Quickstart

Install the Laravel integration, wire in the server key, and evaluate flags using Laravel-friendly patterns.

Prerequisites

  • A Laravel application with Composer and environment configuration.
  • A server key you can place in the Laravel environment file.
  • One boolean flag you can use as a first rollout candidate.
Install bash

composer require zenmanage/zenmanage-laravel

Environment setup

Add the server key to your Laravel environment configuration so the application can initialize the underlying Zenmanage client in the correct environment.

Laravel environment variables dotenv

ZENMANAGE_SERVER_KEY=tok_your_server_key_here
  
Facade-style usage php

use Illuminate\Http\Request;
use Zenmanage\Flags\Context\Context;

$context = Context::single('user', $request->user()->id, $request->user()->name);

$flag = app('zenmanage')->flags()
    ->withContext($context)
    ->single('new-checkout', false);

return view('checkout', ['newCheckout' => $flag->isEnabled()]);

Configuration publishing

If the package exposes publishable configuration in your app, publish it early so operations teams can see the server-key dependency clearly alongside other application configuration.

Framework-native integration

Keep flag evaluation close to the controller, service, job, or view-model that owns the decision. That keeps defaults and failure handling visible in the same place as the behavior being gated.

Next step

Take the next integration step in your own stack.

Start with the quickstart that matches your runtime, then return to the reference pages when you need exact request and payload details.