We've successfully pushed our English translations up to @Crowdin.bsky.social . Merci beaucoup! now, let's automatically translate and pull them back down!
04.08.2025 09:01 β π 4 π 1 π¬ 0 π 0@symfonycasts.com.bsky.social
Injecting Unicorns and Rainbows back into learning PHP // The official way to learn Symfony: http://SymfonyCasts.com
We've successfully pushed our English translations up to @Crowdin.bsky.social . Merci beaucoup! now, let's automatically translate and pull them back down!
04.08.2025 09:01 β π 4 π 1 π¬ 0 π 0For 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.bsky.social, and see how it works!
01.08.2025 09:01 β π 4 π 1 π¬ 0 π 0The translation:extract command automates pulling missing translation keys from your PHP and Twig files. But it also has a secret, secondary purpose... Let's check it out! π΅οΈ
31.07.2025 09:01 β π 1 π 1 π¬ 0 π 0The SymfonyCLI makes local development a breeze - but works best when PHP is installed directly on your machine. Let's walk through setting up PHP (plus database extensions) and the SymfonyCLI on macOS/Linux/Windows so you're ready to start building Symfony apps. symfonycasts.com/blog/install...
30.07.2025 09:02 β π 4 π 1 π¬ 0 π 0I'll admit it, mistakes are going to happen, translations will be missed! Let's look at the tools Symfony provides to help find these and how you can prevent missing translations from making it to production.
30.07.2025 09:01 β π 1 π 1 π¬ 0 π 0HTML in your translations, it's gonna happen. There isn't a perfect solution, so let's take a look at our options.
29.07.2025 09:02 β π 2 π 1 π¬ 0 π 0Let's look at a more complex translation, one with dynamic values and pluralization, because "1 dinosaurs" doesn't sound quite right π¦
28.07.2025 09:01 β π 1 π 1 π¬ 0 π 0One last thing before we finally translate the site: translation "keys". Let's look at why we use these, how to use them, and how YAML helps!
25.07.2025 09:01 β π 1 π 1 π¬ 0 π 0Let's do the real work of translating! See where and how you translate text, the "anatomy" of a translation, creating, and loading them.
24.07.2025 09:01 β π 1 π 1 π¬ 0 π 0Let's create a nifty language switcher widget since having users manually manipulate the URL in their address bar is a huge bummer.
23.07.2025 09:01 β π 2 π 1 π¬ 0 π 0Thereβs one piece of magic needed to get addDroid() to work again: cascade persist. letβs crack open this underused but potentially dangerous option
22.07.2025 09:02 β π 1 π 0 π¬ 0 π 0With the Translation component installed and configured, our next step is to figure out what language a user wants. There are a couple ways to do this, but let's look at the most robust one: Localized, or Translated routing.
22.07.2025 09:02 β π 2 π 1 π¬ 0 π 0π¬π§ π πͺπΈ π π«π· New course all about the Symfony Translation component! We'll take an English-only site, translate it into multiple languages, add a language switcher and let it loose on the world... First let's install the component.
21.07.2025 09:02 β π 4 π 2 π¬ 0 π 0life used to be *so* nice:
$starship->addDroid($droid), then we added this join entity and it all got mucked up: letβs re-add addDroid() & start getting it to work again
Even though our ManyToMany is gone, what we have is still basically a many to many from ship to droids. Letβs start to βhideβ the join entity βimplementationβ detail
18.07.2025 09:03 β π 0 π 0 π¬ 0 π 0With the new join entity setup, persisting is a bit more work (for now), letβs find out how to do it!
17.07.2025 09:03 β π 1 π 0 π¬ 0 π 0Our goal: add extra fields to the ManyToMany join table, but since thatβs not possible, weβll replicate the db relation with a join entity & two ManyToOne relations
16.07.2025 09:03 β π 1 π 0 π¬ 0 π 0How do we join across a ManyToMany relation with that nasty join table in the center? By ignoring it! Itβs all properties & objects
15.07.2025 09:04 β π 0 π 0 π¬ 0 π 0Can we create 100 droids and randomly assign 1-5 of them to each of the 100 starships in the fixtures? With Foundry itβs a simple one liner!
11.07.2025 09:04 β π 1 π 0 π¬ 0 π 0Letβs get into rendering a ManyToMany: because Starship holds a collection of Droid objects, itβs delightfully simple + weβll add a βsmartβ method to Starship
10.07.2025 09:03 β π 3 π 0 π¬ 0 π 0Donβt think: just put the objects together: $ship->addDroid($droid), then marvel as Doctrine handles inserting into and deleting from the join table
09.07.2025 09:02 β π 1 π 0 π¬ 0 π 0Each starship deserves many droids & each droid can serve on many starships. Hey! Thatβs a ManyToMany relation! Once again, Doctrine letβs us think about *objects* instead of db details. But what it does behind the scenes on the db is crazy-cool!
08.07.2025 09:02 β π 0 π 0 π¬ 0 π 0Our starships need droids, ya know for maintenance instead of these unreliable humans (and for comic relief) π€
03.07.2025 09:02 β π 0 π 0 π¬ 0 π 0Time for a quick break from relations to add a search: the Request object & how *not* to do an OR where
02.07.2025 09:02 β π 1 π 0 π¬ 0 π 0What is the N+1 query problem?
Itβs not as bad as the little Bobby Drop Table problem, but it *can* be a performance bummer. Letβs fix with a join & addSelect()
Letβs list some starship parts! Weβll use our relationship from the *otherβ side & see Twigβs neat cycle() function
30.06.2025 09:02 β π 0 π 0 π¬ 0 π 0A hidden treasure in Doctrine is the Criteria object which lets us modify the query on a relation, e.g. so $ship->getParts() only returns parts over a certain price. Magic!
27.06.2025 09:02 β π 1 π 0 π¬ 0 π 0$ship->getParts() is cool. But what if we want to order those parts? Are we out of luck? Nope! Thanks to #[ORM\OrderBy()] symfonycasts.com/screencast/d...
26.06.2025 09:03 β π 1 π 0 π¬ 0 π 0make:entity asks us if we want "orphan removal" for most relationships. Is that as sinister as it sounds? Nope! But letβs find out when itβs useful. symfonycasts.com/screencast/d...
25.06.2025 09:02 β π 1 π 0 π¬ 0 π 0Thereβs a subtle detail in every Doctrine relation: the owning vs side. Weβll chat about what this means and how our *own* code prevents it from being an issue. symfonycasts.com/screencast/d...
24.06.2025 14:50 β π 1 π 0 π¬ 0 π 0