SymfonyCasts Profile Banner
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ Profile
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ

@SymfonyCasts

Followers
8K
Following
348
Media
435
Statuses
3K

Injecting Unicorns and Rainbows back into learning PHP // The official way to learn Symfony: https://t.co/9eMhkJPzhF

Grand Rapids, MI
Joined December 2011
Don't wanna be here? Send us removal request.
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
10 hours
Even if you're developing bundles locally, you'll still need to install them with composer. Installation is a little different... but in a good way! We'll even stumble upon a hidden Symfony Flex feature ๐ŸŒŸ
Tweet card summary image
symfonycasts.com
We have a bundle "package" and bundle class, and even though it lives within our app, we still need to "install" it. This is handled with Composer like normal but the method is a little different
0
0
4
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
1 day
A bundle requires just one thing: a bundle class - the nerve center of your bundle. Let's create one, right after we fix a little quirk when working with multiple namespaces in the same project.
Tweet card summary image
symfonycasts.com
We have a home for our bundle within our app. And, we've set up it's "composer
0
1
7
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
2 days
๐Ÿšจ New course alert: Reusable Bundles ๐Ÿ“ฆ! Bundle development received a facelift in Symfony 6. Letโ€™s check this out by creating a real, usable bundle that weโ€™ll eventually push to Packagist for all to enjoy. Step 1: Initialize our bundle!
0
1
8
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
5 days
If a message fails repeatedly, instead of discarding it forever, let's send it to... the "failure transport"! Let's get this set up & learn how to find out exactly what advanced options each transport has. #Symfony
Tweet card summary image
symfonycasts.com
We now know that each message will be retried 3 times - which is configurable - and then, if handling it *still* fails, it will be "rejected"... which is a "queue" word for: it will be removed from...
0
0
8
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
6 days
Time to look deeper at Messenger's retry settings & more advanced transport config. Retries have an exponential delay built-in to help overcome temporary failures. And of course, you can control all of this. #Symfony
Tweet card summary image
symfonycasts.com
By default, a message will be retried three times then lost forever. Well... in a few minutes... I'll show you how you can *avoid* even *those* messages from being lost
0
1
10
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
7 days
Oh no! You sent your message to a transport/queue, but when it was handled (due to a temporary connection issue) an exception was thrown! Is it lost forever? Nope - Messenger automatically retries it. Let's see retries in action! #Symfony
Tweet card summary image
symfonycasts.com
When you start handling things asynchronously, thinking about what happens when code fails is even *more* important! Why? Well, when you handle things synchronously, if something fails, typically,...
0
1
13
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
11 days
With deep sadness, we share that Ryan Weaver โ€” co-founder of SymfonyCasts, father, husband, beloved teacher, and friend โ€” has passed away after a long and courageous journey with brain cancer.
Tweet card summary image
symfonycasts.com
With deep sadness, we share that Ryan Weaver โ€” co-founder of SymfonyCasts, father, husband, beloved teacher, and friend โ€” has passed away after a long and courageous journey with brain cancer.
3
24
114
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
15 days
Symfony messenger is all about dispatching "messages". But did you know that you can also wrap your message in an Envelope & attach extra config via stamps? Let's use a stamp to *delay* a message *and* see what stamps are added internally.
Tweet card summary image
symfonycasts.com
We just got a request from Ponka herself... and when it comes to this site, Ponka is the boss. She thinks that, when a user uploads a photo, her image is actually being added a little bit *too*...
0
1
9
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
16 days
What happens if *part* of our handler fails? This is nothing new.... unless *some* of your handler is async. Let's route our second message to be async & learn some advanced features of message routing #Symfony
Tweet card summary image
symfonycasts.com
We just broke our image deleting process into smaller pieces by creating a *new* command class, a new handler and *dispatching* that new command from *within* the handler! This... technically isn't...
0
1
6
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
19 days
Half of the work for deleting an image in our app must happen now... but half could happen later. The solution? Split the command into 2 & dispatch from *within* the handler. We're breaking things down into smaller pieces to gain more control. #Symfony
Tweet card summary image
symfonycasts.com
Deleting an image is still done synchronously. You can see it: because I made it *extra* slow for dramatic effect, it takes a couple of seconds to process before it disappears
0
0
5
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
20 days
Let's update our Messenger message class to hold the entity id instead of the entire object. That'll fix a bug and follow a nice rule: make your message as small as possible. Bonus: we'll start learning to fail gracefully & see retries in action #Symfony
Tweet card summary image
symfonycasts.com
Suppose you need your friend to come over and watch your dog for the weekend - let's call her Molly. So you write them a message explaining all the details they need to know: how often to feed Molly,...
0
0
5
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
21 days
A quick aside about Messenger, serializing Doctrine entities & (nerd-alert) the identity map! A fun look into a bug in our app and how Doctrine works internally. #Symfony
Tweet card summary image
symfonycasts.com
We've got a strange issue: we know that "AddPonkaToImageHandler" is being called successfully by the worker process.... because it's *actually* adding Ponka to the images! But, for some reason......
0
0
6
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
23 days
How can we *consume* messages from the queue asynchronously? By running Symfonyโ€™s worker command: php bin/console messenger:consume Dispatching new messages and watching them get handled async automatically? Gorgeous! https://t.co/Kb9LYxOKU5
Tweet media one
0
0
4
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
26 days
Say hello to Messenger transports: the key system that allows you to send message to a queue instead of handling them immediately. Letโ€™s get the Doctrine transport set up, route some messages there and see what it all looks like in the database! #Symfony https://t.co/oHuVytOWhO
Tweet media one
0
1
10
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
27 days
Weโ€™re putting messenger to work, refactoring a controller down to 2 lines! Thatโ€™s thanks to a new command class, a new handler and the debugging superpowers of debug:messenger... when I mess up #Symfony https://t.co/2xqyZdp8te
Tweet media one
0
1
8
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
28 days
The command (message) class and handler inside Messenger are a team: the message class holds *whatever* data you need to pass around while the handler uses that info (+autowired services) to do the work! Itโ€™s refreshingly... simple. #Symfony https://t.co/U7DbTYvybz
Tweet media one
0
1
9
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
29 days
Letโ€™s get to the heart of messenger! Create a message class, a handler class, *link* them together, and dispatch to the bus. Oh... and weโ€™ll explain what the heck a โ€œcommand busโ€ *is* in the first place. #Symfony https://t.co/Xnag70gCE3
Tweet media one
0
1
10
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
1 month
Symfony Messenger! We know youโ€™re going to *love* working with this component... and the app weโ€™ve built with it ? #Symfony #queues #async #cats #hashtags https://t.co/LT59dlkgRX
Tweet media one
0
0
11
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
1 month
We've successfully pushed our English translations up to @Crowdin. Merci beaucoup! now, let's automatically translate and pull them back down!
Tweet card summary image
symfonycasts.com
Our "Space Bar" project on Crowdin is all set up and configured for our app's locales. Let's push up our translations! At your terminal, run: """terminal symfony console translation:push """ Ok, all...
0
1
8
@SymfonyCasts
SymfonyCasts ๐Ÿ‡บ๐Ÿ‡ฆ
1 month
For a course about translations, we really havenโ€™t done much "translating" yet. Thatโ€™s kinda important! Symfony has integrations with a few different Translation Provider services. Letโ€™s look at @Crowdin, and see how it works!
Tweet card summary image
symfonycasts.com
So far, we've mostly focused on translating our site from English to... English... What about French and Spanish? We've talked a bit about how we can manually send our "messages.en
0
3
9