Kevin Bond's Avatar

Kevin Bond

@zenstruck.com.bsky.social

Open Source, #PHP, #Symfony Developer. Writer @SymfonyCasts.com, @Symfony.com Core Member. Author of https://github.com/zenstruck packages.

410 Followers  |  44 Following  |  14 Posts  |  Joined: 02.11.2024  |  1.9794

Latest posts by zenstruck.com on Bluesky

Preview
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...

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
Preview
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

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!

01.08.2025 09:01 β€” πŸ‘ 4    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
`translation:extract` Command So far, we've been creating translation keys and manually adding them, and their values to "messages.en

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! πŸ•΅οΈ

31.07.2025 09:01 β€” πŸ‘ 1    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
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...

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.

30.07.2025 09:01 β€” πŸ‘ 1    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
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…

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...

30.07.2025 09:02 β€” πŸ‘ 4    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
HTML in Translations Here's another complex scenario. On our homepage, scroll down to the footer

HTML 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    πŸ“Œ 0
Preview
Placeholders and Pluralization Onward! Let's find a complex translation scenario. On the article page, scroll down and find the comments section

Let'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    πŸ“Œ 0
Preview
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

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!

25.07.2025 09:01 β€” πŸ‘ 1    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
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

Let'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    πŸ“Œ 0
Preview
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...

Let'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    πŸ“Œ 0
Preview
Localized Routes We installed the translation component. Go us! Also, our pages are advertised via the "lang" attribute as our default locale: "en"

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.

22.07.2025 09:02 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
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...

πŸ‡¬πŸ‡§ πŸ”„ πŸ‡ͺπŸ‡Έ πŸ”„ πŸ‡«πŸ‡· 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    πŸ“Œ 0
Preview
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

If you already love Foundry (I do!), wait until you see how simple it is to create a *fleet* of ships and their parts

20.06.2025 09:03 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
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...

ManyToOne: the king of all relations. The way this looks in PHP & the database is nerd wonderful!

18.06.2025 09:02 β€” πŸ‘ 5    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
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

To track our starship parts let’s create a StarshipPart entity & load the database via Foundry. Don’t forget the β€œpart” called toilet paper!

17.06.2025 09:02 β€” πŸ‘ 3    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
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...

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!

17.06.2025 09:30 β€” πŸ‘ 4    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
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"

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! 🌟

16.06.2025 09:02 β€” πŸ‘ 10    πŸ” 2    πŸ’¬ 0    πŸ“Œ 0
Preview
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

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!

16.06.2025 09:30 β€” πŸ‘ 4    πŸ” 2    πŸ’¬ 0    πŸ“Œ 0

Thanks for having me! Here are the slides: speakerdeck.com/kbond/rethin...

We'll get back to you about the shirts! πŸ˜€

12.06.2025 15:36 β€” πŸ‘ 9    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
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

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 πŸ’…

12.06.2025 09:02 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
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...

Let’s not risk losing sales by redirecting users to Lemon Squeezy to complete their checkout. Instead, bring the checkout to our site!

11.06.2025 09:02 β€” πŸ‘ 3    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

We're thinking of ways to improve. There's a config option to use migrations.

07.06.2025 19:36 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

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)

06.06.2025 20:38 β€” πŸ‘ 4    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0
Preview
Enhancing API Error Handling Head over to "src/Store/LemonSqueezyApi.php"

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 🎯.

06.06.2025 09:03 β€” πŸ‘ 1    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
Rendering LemonSqueezy Orders on the Account Page We've ordered a *ton* of digital lemonade lately, but we don't really have a convenient way to view those orders. Wouldn't it be cool if we could see a list of them on our account page? Now that we've...

How can we display all the orders for a user? Fun fact: we don't need an orders table. Now that we’ve created a connection between our User entity and a Lemon Squeezy customer, let’s use the LS API to show previous orders on our site.

05.06.2025 09:02 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

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

05.06.2025 09:04 β€” πŸ‘ 7    πŸ” 1    πŸ’¬ 0    πŸ“Œ 1
Preview
Writing an Integrational Test for Webhooks Previously, we set up a webhook that saves the customer ID of the user who placed an order. Webhooks are both incredibly useful and *slightly* terrifying

Tests are always important, but even more so when dealing with e-commerce. Let’s write a full integration test for our LemonSqueezy webhook so we can sleep easy at night! 😴

29.05.2025 09:02 β€” πŸ‘ 3    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0
Preview
Implementing the Webhook Consumer In the last chapter, we successfully set up the webhook request parser. This parser is designed to receive a webhook from LemonSqueezy, verify its signature, parse the payload, and pass the parsed data...

We have Symfony successfully parsing our Lemon Squeezy webhook. Now, let’s create a RemoteEvent consumer to handle all that webhook biz logic!

28.05.2025 09:02 β€” πŸ‘ 2    πŸ” 1    πŸ’¬ 0    πŸ“Œ 0

Don't worry, Foundry 3.0 will be perfect!

25.05.2025 20:38 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

Every time, without fail...

25.05.2025 18:31 β€” πŸ‘ 6    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

@zenstruck.com is following 20 prominent accounts