Source: juststeveking.uk

Laravel Pennant
Laravel Pennant is a package created by the Laravel team that will arrive with https://laravel-news.com/laravel-10 provides Feature Flags for your applications. Feature flags enable you to incrementally roll out new application features with confidence, A/B test new interface designs, compliment a trunk-based development strategy, and much more.

Creating a new feature is a simple process of defining it with your AppServiceProvider like so: public function boot(): void { Feature::define('beta-testers', fn (User $user) => match (true) { $user->isBetaTester() => true, default => false, }); }

However, you can also use a class-based approach to your features: class BetaTesters { public function resolve(User $user): mixed { return match (true) { $user->isBetaTester() => true, default => false, }; }}

class PodcastController { public function __construct( private readonly RedirectAction $action, ) {} public function index(Request $request): Response { return Feature::when(BetaTester::class, fn () => $this->action->handle('v2'), fn () => $this->action->handle('v1'), ); }}
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners