What is Laravel Pennant?

Answer

Laravel Pennant (first-party package) is a feature flag library for gradually rolling out new application features. Define flags in a service provider: Feature::define("new-checkout", fn($user) => $user->isInBeta()). Check the flag: Feature::active("new-checkout") or in Blade: @feature("new-checkout") ... @endfeature. Deactivate: Feature::deactivate("new-checkout", $user). Pennant stores flag values (by default in the database) per user, so you can activate a feature for specific users or segments. Flags can be percentage-based for gradual rollouts: fn($user) => Hash::check($user->id, config("pennant.seed")) % 100 < 20 (20% of users). Feature flags enable A/B testing, canary deployments, and safe gradual feature rollouts without deploying new code.