What is Laravel Pennant?

Why Interviewers Ask This

Interviewers ask this to evaluate whether you have the depth of knowledge needed to mentor others and lead technical decisions. The expected answer goes beyond definitions into practical implications and real-world consequences.

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.

Common Mistake

Many candidates answer correctly but can't explain the 'why'. Always be prepared to justify your answer with a concrete example or use case from your Laravel experience.