Kevin Bond
banner
zenstruck.com
Kevin Bond
@zenstruck.com
Open Source, #PHP, #Symfony Developer. Writer @SymfonyCasts.com, @Symfony.com Core Member. Author of https://github.com/zenstruck packages.
Reposted by Kevin Bond
Our translations work 🥳 but relying on the idea that all entities will have a getId() method? Kinda risky. Let’s make it rock-solid by letting Doctrine handle ID fetching - no hoping and wishing needed!
Fetch the Object ID with Doctrine
Currently, our French translation data is being successfully displayed on the page. However, our current method of fetching the ID using "$object->getId()" is a bit shaky
symfonycasts.com
October 6, 2025 at 9:01 AM
Reposted by Kevin Bond
🚨 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!
Initialize the Bundle
Hey friends! Welcome to the *Reusable Symfony Bundle* course. I'm Kevin, and I'll be your *bundle navigator* on this journey
symfonycasts.com
September 8, 2025 at 9:02 AM
Reposted by Kevin Bond
We've successfully pushed our English translations up to @Crowdin.bsky.social . Merci beaucoup! now, let's automatically translate and pull them back down!
Pushing & Pulling Translations
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 our...
symfonycasts.com
August 4, 2025 at 9:01 AM
Reposted by Kevin Bond
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.bsky.social, and see how it works!
Translation Providers
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
symfonycasts.com
August 1, 2025 at 9:01 AM
Reposted by Kevin Bond
The 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! 🕵️
`translation:extract` Command
So far, we've been creating translation keys and manually adding them, and their values to "messages.en
symfonycasts.com
July 31, 2025 at 9:01 AM
Reposted by Kevin Bond
I'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.
Debugging & Linting Translations
Did you finish your homework? Don't worry, neither did I! Let's bike shed that for now and look at debugging translations. This'll be helpful for that homework anyway! ## Web Debug Toolbar On the English...
symfonycasts.com
July 30, 2025 at 9:01 AM
Reposted by Kevin Bond
The 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...
Installing PHP and Symfony CLI Locally
The Symfony CLI makes local development a breeze - but it works best when PHP is installed directly on your machine. Let's walk through setting up PHP (plus common database extensions) and the…
symfonycasts.com
July 30, 2025 at 9:02 AM
Reposted by Kevin Bond
HTML in your translations, it's gonna happen. There isn't a perfect solution, so let's take a look at our options.
HTML in Translations
Here's another complex scenario. On our homepage, scroll down to the footer
symfonycasts.com
July 29, 2025 at 9:02 AM
Reposted by Kevin Bond
Let's look at a more complex translation, one with dynamic values and pluralization, because "1 dinosaurs" doesn't sound quite right 🦖
Placeholders and Pluralization
Onward! Let's find a complex translation scenario. On the article page, scroll down and find the comments section
symfonycasts.com
July 28, 2025 at 9:01 AM
Reposted by Kevin Bond
One 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!
Translation "Keys"
We're *almost* ready to start translating this site! But before we get started, I want to show a little teensy tiny problem with our setup so far. We still have this "Hello World!" text so jump into "templates/article/index
symfonycasts.com
July 25, 2025 at 9:01 AM
Reposted by Kevin Bond
Let's do the real work of translating! See where and how you translate text, the "anatomy" of a translation, creating, and loading them.
Translating Content
It's time to actually do some translating! There's two main places you typically translate content. First: in PHP code, like flash messages in your controllers
symfonycasts.com
July 24, 2025 at 9:01 AM
Reposted by Kevin Bond
Let's create a nifty language switcher widget since having users manually manipulate the URL in their address bar is a huge bummer.
Create a Language Switcher
We have localized routing up and running, but we can only switch locales by manually updating the URL. That won't do! Instead, let's add a language switcher! Up here, next to our search form, we need...
symfonycasts.com
July 23, 2025 at 9:01 AM
Reposted by Kevin Bond
With 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.
Localized Routes
We installed the translation component. Go us! Also, our pages are advertised via the "lang" attribute as our default locale: "en"
symfonycasts.com
July 22, 2025 at 9:02 AM
Reposted by Kevin Bond
🇬🇧 🔄 🇪🇸 🔄 🇫🇷 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.
Installing the Translation Component
Hey friends! e alegro de que te hayas unido a mí en este curso de sobre las traducciones de Symfony! In this tutorial, we're celebrating one of the oldest components in Symfony, but for the first time...
symfonycasts.com
July 21, 2025 at 9:02 AM
Reposted by Kevin Bond
If you already love Foundry (I do!), wait until you see how simple it is to create a *fleet* of ships and their parts
Setting Relations in Foundry
We have a couple of parts and a few starships, but to fill our testing data fleet: I want a *lot* more. This is a job perfectly suited for our good friend: Foundry
symfonycasts.com
June 20, 2025 at 9:03 AM
Reposted by Kevin Bond
ManyToOne: the king of all relations. The way this looks in PHP & the database is nerd wonderful!
Many To One: The King of Relationships
Alright folks, we've successfully built "Starship" and "StarshipPart" entities, and... they're sitting pretty in the database. But here's the puzzle: how do we *attach* these parts to their respective...
symfonycasts.com
June 18, 2025 at 9:02 AM
Reposted by Kevin Bond
To track our starship parts let’s create a StarshipPart entity & load the database via Foundry. Don’t forget the “part” called toilet paper!
Part Entity
We already have starships showing up on the homepage thanks to the "Starship" entity we built in the last tutorial. But now, it's time to step up our game
symfonycasts.com
June 17, 2025 at 9:02 AM
Reposted by Kevin Bond
Our Javascript event listener to sync LemonSqueezy customers with our app users has a little security issue. We could disable the listener in production and just rely on webhooks but that's lame! Let's fix the problem!
Improving Javascript Event Security
We've now showed syncing our LemonSqueezy customer ID with the user in our database using two different methods: *webhooks*, which made for a pretty solid production setup, and via *LemonSqueezy JavaScript...
symfonycasts.com
June 17, 2025 at 9:30 AM
Reposted by Kevin Bond
New tutorial time! We’re catching up & finishing up (I know, way overdue 🧠 ) our Symfony 7 track with Symfony 7 Doctrine Relations! We’re kicking off with alien animations AND audio from me, @weaverryan! 🌟
Setup
Hey friends! Welcome back! And welcome back to me if I can be so bold. I'm returning from my 14-month brain cancer "vacation"
symfonycasts.com
June 16, 2025 at 9:02 AM
Reposted by Kevin Bond
Working with webhooks locally can be a bit of a pain, even with Ngrok. Let's look at an alternative way to sync our app users with LemonSqueezy customers: Javascript events!
Listening to LemonSqueezy Javascript Events
Right now, every time we want to save a LemonSqueezy customer ID on the corresponding user entity *locally*, we have to configure our webhooks. Ngrok definitely helps, but it's still a bit of a pain
symfonycasts.com
June 16, 2025 at 9:30 AM
Thanks for having me! Here are the slides: speakerdeck.com/kbond/rethin...

We'll get back to you about the shirts! 😀
June 12, 2025 at 3:36 PM
Reposted by Kevin Bond
The LemonSqueezy checkout now happens in our app, booya! But, it's pretty subtle. Let's embed it in a modal and fine-tune the "open checkout" button 💅
Embedding the LemonSqueezy Checkout Overlay
In the last chapter, we got our hands dirty and built a custom LemonSqueezy Stimulus controller. It pulls up the LemonSqueezy checkout page in an iFrame right in our site
symfonycasts.com
June 12, 2025 at 9:02 AM
Reposted by Kevin Bond
Let’s not risk losing sales by redirecting users to Lemon Squeezy to complete their checkout. Instead, bring the checkout to our site!
LemonSqueezy Checkout Overlay
Customers can purchase products on our *website*, but to *finalize* the checkout, we've been redirecting them to LemonSqueezy's site, which is hosted on a completely different domain. Let's use LemonSqueezy's...
symfonycasts.com
June 11, 2025 at 9:02 AM
Foundry now has it's own command to load dev fixtures! (previously, we recommended using doctrine/fixtures, which is a great package, but overkill for this purpose)
Foundry 2.6 is released 🎉

We've introduced a new command `bin/console foundry:load-stories` you can use to load fixtures in your database

see docs for more info symfony.com/bundles/Zens...

@zenstruck.com
#php #symfony
symfony.com
June 6, 2025 at 8:38 PM
Reposted by Kevin Bond
dd()'ing API errors is getting old fast... and it won't help us in production. Let's craft a custom exception that gives us a message that's simpler and to the point 🎯.
Enhancing API Error Handling
Head over to "src/Store/LemonSqueezyApi.php"
symfonycasts.com
June 6, 2025 at 9:03 AM