Laravel Pennant: first-party feature flags

preview_player
Показать описание
In this video, I give you an overview of Laravel Pennant, a first-party feature flag library for Laravel that makes it easy to manage feature rollouts and A/B testing within your applications. We’ll explore how to set up and use Laravel Pennant, define and resolve feature flags, and integrate them into your views, middleware, and application logic for seamless feature management.

Follow Aaron:

Featured in this episode:

Chapters:
00:00 - Introduction to Laravel Pennant
00:24 - What is Laravel Pennant?
01:07 - Installing Laravel Pennant
01:41 - Setting Up Configuration and Migration
02:23 - Understanding Feature Stores
03:02 - Defining a New Feature Flag
05:00 - Resolving Feature Flags in Middleware and Views
06:40 - Checking Feature Flags for Different Users
07:59 - Persisting Resolved Feature Flags in the Database
08:34 - Using Lottery to Randomly Assign Feature Flags
09:28 - Implementing Feature Flag Middleware
10:24 - Defining Non-Boolean Feature Flags (e.g., Themes)
11:35 - Clearing Feature Flag Data from the Database
12:09 - Resolving Feature Flags in Blade Templates
13:46 - Using Blade Directives for Complex Feature Logic
14:10 - Check Out My Video on Laravel Octane
Рекомендации по теме
Комментарии
Автор

Maybe this will be weird, but YAY ADS! I'm not being sarcastic - getting sponsorships increases the likelihood that we will continue seeing this amazing well-crafted content and I'm stoked for that ❤
Also, thank you both for another great video!

TheMoonWatcher
Автор

I'm a 41 years old guy, I started programming in PHP with 16 years old, landed my first job as a programer at 21, I did amazing thing with PHP. Now, it's been almost 12 years that I don't use it anymore, but my brain still finds it easier to learn thing in PHP than using my current stack, funny how that works....

nmx
Автор

Awesome content Aaron 👍 Your super educational way of teaching got me into php and Laravel after years of hesitating to try it, and now there is no way back. Thanks for sharing your knowledge mate ♥

HusseinAli-ihtk
Автор

First party? That's sucks. I wanna pay $20 per month for SaaS subscription to do that.

rodjenihm
Автор

I’m so glad to see you making content on your own channel. To the moon my friend, to the moon!

nicgeorge
Автор

Currently building a quite complex meta search engine and Laravel makes it so easy. Probably launching production this year. If i did it in another stack it'd probably take me more than a year

GuRuGeorge
Автор

Another banger, though dark mode would make it a lot easier to watch at night 🔥👀

Alex_online
Автор

Woah .. this is so much better than what I have had to do in Node.js and Next.js applications!!

jagadishk
Автор

Aaron, a tip for the artisan cli: if you type `artisan <namespace>` you will get all the commands in that namespace. For a shorter display you can make it error out adding the : after the namespace.

rationalityfirst
Автор

Simply so great and clearly explained! Thank you!

yeapea
Автор

"That seems....pretty ~dumb~" - Aaron Francis, looking at his own code.

Love the video! Bookmarking literally all of these to send to people when they ask me why I still use PHP/Laravel in 2024

alexandersix_
Автор

It's great to have first-party FF, nice video man.

nulljeroka
Автор

If not because of subscribing to you, i would not have known about this neat feature flags in laravel. I usually use spatie permission and sometimes it just too granullar for my use cases, maybe the thing i need for my past projects was this feature flags. Thank you Aaron!

Maybe for future topics, is there an Alert System in Laravel to notify developer if some user encounter error in their production apps?
Keep up the good works, your videos is very pleasant to hear!

ihzakarunia
Автор

Hi Aaron, me too I prefer light mode to work but I find that dark mode more versatile for videos for two reasons: first, white is too bright when watching at night 😅 and two, switching from full frame video to white editor is too harsh. Anyway, just my 2 cents. Keep up the good work.

fromvega
Автор

I don't use Laravel, and last time I touched PHP was over 6 years ago... Why am I here? 😂
PS: Awesome video, as always! 😊

DanielDogeanu
Автор

Can you sometimes share your PHP Storm config? Looks pretty neat.

vdemcak
Автор

Pennant looks great. The problem I have with feature flags is that people abuse it. I have seen codebase with hundreds of feature flags, a thousands of dead lines of code, never been deployed/used. Also I have seen deployments failing because of too many if/then. Because when you develop a feature you have code regarding that feature everywhere. So feature flags should be only used when strictly necessary, , and not as development approach. Having only the master branch and relaying exclusively on feature flags is a (very) bad idea. Trunk development is a bad idea. Use branches, gitflow, and eventually feature flags, when you are rolling out features that require to be tested by a restricted number of users. This is not the case for all the features, this is the case for just a small percentage of you develop. Abusing feature flags will make your code unreadable. Also flags should be removed when the feature is released for all. Does Pennant have something for that?

biomorphic
Автор

These videos make me want to use Laravel more and more. I wonder how hard it’d be to swap now. I have been working on a Vue 3 front end and just started the backend portion. Express is proving to be a headache for logging in with Steam 💀

I might have to learn more and see if this is the perfect fit, I’m just not too sure how to best connect existing data or if I can define models for an existing schema. I’ll have to investigate 🕵️‍♂️

Torbikini
Автор

I'm curious what is the Database management tool you use in this video?
Is that DB Browser?

edventuretech
Автор

What's the name of white theme of phpstorm? I liked it.

rajeshbudhathoki