Laravel

How to install Laravel Pennant for A/B testing without DB migrations?

December 3, 2025

download ready
Thank You
Your submission has been received.
We will be in touch and contact you soon!

Laravel Pennant provides Redis-backed feature flags enabling safe rollouts, user segmentation, and percentage-based activation without database schema changes. Install via Composer, configure Redis, publish config, activate features with Feature::activate(), toggle in Blade with @pennant directive. Supports scoped segments and gradual rollouts from 0-100% with automatic cleanup.

Example:-

Step 1:-Install package

Code

composer require laravel/pennant
      

Step 2:-Configure Redis

Code

echo "CACHE_DRIVER=redis" >> .env
echo "REDIS_HOST=127.0.0.1" >> .env
      

Step 3:-Publish config

Code

php artisan pennant:install
      

Step 4:-Activate feature

Code

Feature::activate('new-checkout', percentage: 25);
      

Step 5:-Blade directive

Code

@pennant('new-checkout')
    New Checkout UI
@else
    Legacy Checkout
@endpennant
      
Hire Now!

Need Help with Laravel Development ?

Work with our skilled laravel developers to accelerate your project and boost its performance.
**Hire now**Hire Now**Hire Now**Hire now**Hire now

How to install Laravel Pennant for A/B testing without DB migrations?

Laravel Pennant provides Redis-backed feature flags enabling safe rollouts, user segmentation, and percentage-based activation without database schema changes. Install via Composer, configure Redis, publish config, activate features with Feature::activate(), toggle in Blade with @pennant directive. Supports scoped segments and gradual rollouts from 0-100% with automatic cleanup.

Example:-

Step 1:-Install package

Code

composer require laravel/pennant
      

Step 2:-Configure Redis

Code

echo "CACHE_DRIVER=redis" >> .env
echo "REDIS_HOST=127.0.0.1" >> .env
      

Step 3:-Publish config

Code

php artisan pennant:install
      

Step 4:-Activate feature

Code

Feature::activate('new-checkout', percentage: 25);
      

Step 5:-Blade directive

Code

@pennant('new-checkout')
    New Checkout UI
@else
    Legacy Checkout
@endpennant