Rewind ⏪ Symfony Messenger #32
We've talked about command & event buses already. Now it's time to talk about the final type: a school bus! I mean, a query bus!? symfonycasts.com/screencast/m...
Rewind ⏪ Symfony Messenger #32
We've talked about command & event buses already. Now it's time to talk about the final type: a school bus! I mean, a query bus!? symfonycasts.com/screencast/m...
Rewind ⏪ Symfony Messenger #31
Ready to see a cool Symfony services config trick? We use auto-registration, sub-directories and tags to bind our command handlers *only* to the command bus & our event handlers *only* to the event bus. An optional, but geeky-fun step! symfonycasts.com/screencast/m...
Rewind ⏪ Symfony Messenger #30
Messenger has a few other built-in, but optional middleware that we haven't talked about. Let's look into the validation & doctrine_transaction middleware, talk about what each does and why you might (or might not) use them #Symfony symfonycasts.com/screencast/m...
Twig loads all extensions on each request - even unused ones. To keep things fast, push heavy logic into a Twig runtime. Pro tip: the runtime can be any service, not just something Twig-specific.
👉 symfonycasts.com/screencast/b...
Rewind ⏪ Symfony Messenger #29
If Symfony has an EventDispatcher... and also Messenger is able to dispatch events... what’s the difference between EventDispatcher & Messenger? And when should I use one versus the other? Excellent question! symfonycasts.com/screencast/m...
Rewind ⏪ Symfony Messenger #28
We’ve created an “event” and an “event handler”. Let’s finish this by dispatching that into our Messenger-powered event bus. Also: what happens if an event has *no* handlers? In a perfect world... that should be allowed. #Symfony symfonycasts.com/screencast/m...
Rewind ⏪ Symfony Messenger #27
Event time! We’ll create our first “event” class for Messenger & corresponding event handler. What’s the difference between an event and a message? Let’s find out! #Symfony symfonycasts.com/screencast/m...
Rewind ⏪ Symfony Messenger #26
We’re on our way to using Messenger as an event bus! Let’s configure a separate bus service for this & see “named autowiring” in action: the system that allows you to autowire different message bus services in different situations symfonycasts.com/screencast/m...
When building bundles, not every class is meant to be used by end users. My preference is to mark those as "internal", and "hide" services so they don’t show up during container debugging. Here’s how I do it 👉 symfonycasts.com/screencast/b...
Rewind ⏪ Symfony Messenger #25 When you deploy new code to your Symfony app, will your workers see the new code? Not until you restart them! Learn about a command to restart *all* workers, options to make sure workers don't run too long & an updating messages gotcha symfonycasts.com/screencast/m...
Rewind ⏪ Symfony Messenger #24 Deploy time! Messenger is delivering messages to our queue... but how do we run our workers on production? If your host doesn't handle it for you, Supervisor will. Let's get this tool set up, kill some workers & watch them restart symfonycasts.com/screencast/m...
Want to unlock the power of #Symfony Flex for your own bundles? Learn how to create a "contrib" Flex recipe with us -> symfonycasts.com/screencast/b...
Have you ever built a PHP package you’re proud of? Well, you should publish it to Packagist so anyone can install and use it with Composer. Here’s a quick tutorial on how to do it -> symfonycasts.com/screencast/b...
Want every push to your PHP project tested automatically? GitHub Actions makes that easy! Here’s how to get started quickly: symfonycasts.com/screencast/b...
Symfony Form Basics #11
Let’s wrap up our unmapped form by switching it to GET, cleaning up the query string, reading the submitted data, and giving it a Turbo-powered boost ⚡.
Find bugs without even running your code. Use PHPStan to add static analysis to your project and start catching issues your tests miss --> symfonycasts.com/screencast/b...
Symfony Form Basics #10
Symfony form types don’t have to be tied to an entity. Let’s turn a plain HTML form into a Symfony form and explore some other cool options along the way!
Consistent code style = happier humans reading your code. Install PHP-CS-Fixer and start automating the boring stuff --> symfonycasts.com/screencast/b...
Symfony Form Basics #9
A fully customizable CRUD for an entity in seconds? What a dream! One command gives us the whole UI, then we step in for the fun part: tweaks, fixes, and styling!
Happy Thursday - here's a quick guide to stateful vs stateless CSRF protection in Symfony — and how request protection works today. #Symfony #shorts
www.youtube.com/shorts/URNBE...
Symfony Form Basics #8 Time for some polish 💅. We’ll reorder fields, customize the layout, and tweak styling directly in Twig. Then handle global form errors and add help text that steers users away from validation errors in the first place. symfonycasts.com/screencast/s...
Symfony Form Basics #7 Validation isn’t just for form types. We’ll move constraints onto our entities, explore how null values bypass most constraints (and how NotBlank changes that), then wrap things up with CSRF protection!
Rewind ⏪ Symfony Messenger #23
By using Symfony’s in-memory transport, we can short-circuit the message delivery system in the test environment and assert that the *exact* right message was sent. Boom!
symfonycasts.com/screencast/m...
Symfony Form Basics #6 Client-side HTML5 validation is nice… but it’s easy to bypass. Let’s add real server-side validation with the Validator component!
Rewind ⏪ Symfony Messenger #22
How can we unit test our Messenger setup? Since we’re writing great code, we can unit test all of it! Let’s bootstrap a functional test for the upload endpoint on our way to asserting that the message was received by the transport!
symfonycasts.com/screencast/m...
Symfony Form Basics #5
Time to dress our form up for the big dance! We'll apply a built-in form theme, adjust individual field attributes, and improve the `EntityType` user experience. 💅
Rewind ⏪ Symfony Messenger #21
While developing, you *can* run the “messenger:consume” command to handle the messages. *Or*, you can use the “sync” transport and a configuration trick to handle messages *now* and keep life simple. #Symfony
symfonycasts.com/screencast/m...
Rewind ⏪ Symfony Messenger #20
Some messages are more important than others. If your queue gets filled with a mixture of “super important” and “less important” messages, can we tell Messenger which to handle first? Totally! By creating “priority transports” #Symfony
symfonycasts.com/screencast/m...