Skip to content

Feature flags for Laravel, the Pennant way.

FlagPal for Laravel is a Pennant driver. Keep Feature::active() and @feature as they are. Behind them you get a dashboard for remote config, targeting rules, A/B tests and metrics that the rest of your team can use too, and changes there don't need a deploy.

PHP 8.2+ · Laravel 11 or 12 · No credit card required

  • Pennant A native driver. Feature::active() and Feature::value() stay plain Laravel
  • 5 min One Composer package, one config file and four .env keys
  • Unlimited Traffic and flag evaluations, one flat monthly price
Feature.php php
use Laravel\Pennant\Feature;

// Same Pennant API you already use
if (Feature::active('new-checkout')) {
    // show the new checkout
}

// Pennant's Blade directives keep working, too
@feature('beta-theme')
    <link rel="stylesheet" href="beta.css">
@endfeature

// Remote config: read the value FlagPal serves
$color = Feature::value('checkout-button-color');

There's no new API to learn. The driver plugs into Pennant's store layer, so your feature checks stay plain Laravel and the values come from the dashboard.

Why FlagPal for Laravel

Pennant, plus the dashboard it never had.

Pennant has a nice feature-flag API, but nowhere to manage flags, target users, run experiments or look at results. The FlagPal driver adds that, behind the same calls you already use.

  • Keep the Pennant API you already use

    FlagPal for Laravel is a Pennant driver, so Feature::active(), Feature::value() and Pennant's Blade directives work the same as before. What changes is where the values come from: a dashboard where you can adjust rollout percentages, targeting rules and experiment variants without deploying.

    • Feature::active()
    • Feature::value()
    • @feature
    • PENNANT_STORE=flagpal
  • Remote config without a deploy

    Flags can be boolean, string, integer, array or date. That means a rate limit, a payment gateway or a simple on/off becomes a value you edit in the dashboard rather than a code change.

  • Target on your own user properties

    Any property your app sends (country, plan, signup_date and so on) can be used in targeting rules, and rules combine with AND. Flags set by one Experience carry over to the next, so you can chain them without writing if/else.

  • A/B tests with real statistics

    Split matched users across variants by weight and attach a metric (boolean, count or money). The dashboard shows conversion per variant, how likely each one is to be the best, and whether the result is statistically significant.

  • Sub-millisecond flag reads

    The driver caches resolved flags in whichever cache store you pick, so reads stay local. If you add FlagPal's signed webhooks, changes saved in the dashboard reach your app as soon as they're made.

  • Unlimited traffic, one flat price

    Evaluation happens in your app, so we don't meter requests, users or evaluations. Whether you have 100 users or 100 million, the bill is the same.

  • Set up by developers, used by everyone

    You install the official Laravel SDK once (it talks to a JSON:API REST backend). After that, product managers, marketers and analysts can create flags, target users, run experiments and read results in the dashboard without waiting on a deploy.

    • Drop-in replacement
    • JSON:API REST
    • Local resolution
    • Community contributions

    Read the integration guide (opens in a new tab)

How it works

From idea to result in three steps.

You install the driver once (the four steps are below). After that, flags, targeting, experiments and results all live in the dashboard, and the only extra code is one middleware and one metric call. The concepts match the docs (opens in a new tab): Feature Flags, Experiences, Experiments and Metrics.

  1. Dashboard · any role

    Step 1: Define flags

    Create typed flags in the dashboard (boolean, string, integer, array or date) and read them through Pennant. checkout-button-color is a string flag, so your code calls Feature::value() instead of hardcoding "blue" or "green".

    Feature set · Green checkout button What this variant sets

    Users in this variant get

    Try it: change a flag or its value, or add another one.

  2. Dashboard · product and marketing

    Step 2: Deliver with Experiences & Experiments

    An Experience gives one feature set to everyone who matches your rules. An Experiment splits those users across variants by weight. Rules use the properties your app sends as flags, like country, plan or signup_date, and combine with AND. Start with a small slice of traffic and increase it from the dashboard.

    Green checkout button · Experiment Traffic · 25% of users

    Who takes part · all rules must match

    Users where

    Start small, raise it when you are confident. Everyone else keeps the blue button.

    What each group sees · split by weight

    • Control 50%

      checkout-button-color = "blue"

    • Variant 50%

      checkout-button-color = "green"

    Try it: edit the targeting rules or move the traffic slider.

  3. Code once · dashboard after

    Step 3: Measure and roll out the winner

    Register the RecordEnteredExperiments middleware once and the SDK will count who saw each variant after the response goes out. When a user converts, call recordMetric(). The dashboard shows conversion per variant, the probability each one is best, and when the result becomes statistically significant. Then one switch turns the winner into an Experience for everyone.

    Exposures and conversions php
    // bootstrap/app.php - count who saw each variant, after the response is sent
    ->withMiddleware(function (Middleware $middleware) {
        $middleware->append(\FlagPal\FlagPal\Http\Middleware\RecordEnteredExperiments::class);
    })
    
    // When the purchase completes, record the conversion against the variant they saw
    foreach ($flagPal->getEnteredFunnels() as $entry) {
        $flagPal->recordMetric(new Metric(['name' => 'conversion']), $entry->set, 1);
    }
    Green checkout button · Result Day 14 · statistically significant
    • Control · blue 2.97%

      1,010 users · 30 conversions

    • Variant · green Winner 5.01%

      1,017 users · 51 conversions

    +69% conversion · 99% probability to be best

    Green button for everyone Draft

    Sets checkout-button-color = "green"

    Turn the winning variant into an Experience for every user.

    Try it: flip the switch to roll the winner out to everyone.

Get started

Up and running in about five minutes.

Since FlagPal for Laravel is a Pennant driver, installing it means one Composer package, one config file and four environment keys.

  1. Step 1

    Install the package

    Just one Composer package. It registers the flagpal Pennant store for you, so you don't need to touch config/pennant.php.

    terminal shell
    composer require flagpal/flagpal-for-laravel
  2. Step 2

    Publish the config

    This creates config/flagpal.php, where projects, caching and logging are configured. The defaults work fine for a single project.

    terminal shell
    php artisan vendor:publish --tag="flagpal-for-laravel-config"
  3. Step 3

    Point Pennant at FlagPal

    Paste in the API URL and token from your FlagPal project, then make flagpal Pennant's default store. If you skip that, Feature::active() will keep using the database driver.

    .env dotenv
    FLAGPAL_URL=https://flagpal.com/api/v1
    FLAGPAL_PROJECT="My Project"
    FLAGPAL_MY_PROJECT_TOKEN=your-token-here
    PENNANT_STORE=flagpal
  4. Step 4

    Read a flag anywhere

    This is plain Pennant. new-checkout is a flag you define in the dashboard, where you can flip it, target it or split it without a deploy.

    app/Http/Controllers/CheckoutController.php php
    use Laravel\Pennant\Feature;
    
    if (Feature::active('new-checkout')) {
        // show the new checkout
    }

Pricing

Flat pricing, however much traffic you get.

Flags are evaluated inside your app, so we have nothing to meter and don't charge per seat or per request. Pick a plan and invite whoever needs access.

Free

€0.00 / month

For evaluation and side projects.

  • Every feature, no time limit
  • Unlimited traffic & evaluations
  • 1 Project and member
  • 1 Active experiment
  • 1-month data retention

Starter

€5.99 / month

For one product and the people shipping it.

  • Everything in Free
  • 1 project, unlimited members
  • Unlimited active experiments
  • Alerts when experiments win
  • 12-month data retention

Team

Most popular

€9.99 / month

For teams running several products.

  • Everything in Starter
  • Unlimited projects and members
  • Unlimited data retention
  • Priority support
  • Unlimited traffic and evaluations

    Flags are resolved from a local cache in your app, so there are no requests or users for us to count. A traffic spike costs the same as a quiet Tuesday.

  • No per-seat fees

    Bring in developers, PMs, marketers and analysts. Adding people to the dashboard doesn't change the price.

  • Start free, upgrade when you go live

    The free plan has every feature and doesn't expire. Upgrade once FlagPal is running in production.

Prices in EUR, billed monthly. Questions about billing or setup? Read the FAQ.

FAQ

Questions Laravel developers usually ask first.

Pennant, caching, security and results, in short. The docs and the SDK README have the details.

Still have a question?

The docs have the full FAQ and all the guides, from creating your first flag to reading results.

Browse the docs FAQ (opens in a new tab)

  • No, it plugs into it. FlagPal for Laravel registers a flagpal Pennant store, so Feature::active(), Feature::value() and Pennant's Blade directives keep working as before. Set PENNANT_STORE=flagpal and the values behind them (rollout percentages, targeting rules, experiment variants) come from the dashboard, where you can change them without deploying.

    Not using Pennant? The SDK also works on its own. FlagPal::resolveFeatures() returns the resolved feature array.

    The SDK README on GitHub (opens in a new tab)

  • Every plan is a flat monthly fee, whatever your traffic. The driver resolves flags from a local cache and FlagPal only tells your app what changed, so there are no requests, users or evaluations for us to meter. As a bonus, fewer round trips mean faster responses and one less thing in your request path that can fail.

  • Under a millisecond once it's cached. The driver keeps resolved flags in whichever cache store you pick (set the store and TTL in config/flagpal.php), so requests read from the cache instead of calling FlagPal every time. If you want changes to land immediately, add a webhook endpoint. FlagPal sends a signed event whenever a flag, Experience or Experiment changes, and your app refreshes its cache.

    Webhooks & cache synchronisation (opens in a new tab)

  • Use an Experience to give one feature set to the users who match your rules, like a beta group, a country or a plan. It's also what you use for gradual rollouts. Use an Experiment when you want to split those users across variants by weight and see which one does better.

    ExperienceExperiment
    PurposeRoll out a featureA/B test two+ variants
    VariantsSingleMultiple
    Needs metrics?NoYes
  • Add the RecordEnteredExperiments middleware once and the SDK will record exposures automatically after the response is sent. When the goal happens (a purchase, a signup), call recordMetric() for the variant the user was in. There are three metric types: boolean (did it happen?), count (how many times?) and money (how much?). The dashboard turns them into conversion per variant, the probability each one is best, and whether the result is statistically significant.

    How to read experiment results (opens in a new tab)

  • The package comes with a cookie-backed GuestScope. Resolve Pennant's scope to the logged-in user, or fall back to the guest scope when there isn't one. Anonymous visitors then keep the same feature values and experiment variant across requests for the configured TTL (30 days by default).

  • API access uses bearer tokens scoped to a project. Every webhook is signed with HMAC-SHA256 in a Signature header. A webhook secret is required, so you can always verify a payload with a constant-time comparison before acting on it. Failed deliveries are retried with exponential backoff.

    Webhooks & signature verification (opens in a new tab)

  • No. A developer sets up the driver once, and after that product managers, marketers and analysts can create flags, set up Experiences, run Experiments and read metrics in the dashboard without writing code. The only code involved is the flag check you'd have written anyway.

Get started

Add a flag to your next PR.

Sign up for free (no card needed), install the driver, point Pennant at FlagPal and read your first flag from the dashboard. It takes about five minutes.

What you get today

  • Free plan with every feature, no expiry
  • No credit card required
  • Unlimited traffic and flag evaluations from day one
  • Installed with Composer in about 5 minutes

Want the full walkthrough first? The SDK README (opens in a new tab) walks through installing, setting up your first A/B test and recording conversions.