Cosmic Coding with Symfony 7
Feel dangerous with Symfony 7! This tutorial teaches the fundamentals, the how and why while building a real-life web application.
- beginner
- 4087 students
- EN/ES Captions
- EN/ES Script
- Certificate of Completion
Your Guides
About this course
Symfony 7, yes! If you're ready to get serious about web dev - whether you're building a JSON API or a rich web app - you've come to the right place! Symfony is the famous backbone for the most popular PHP libraries, embraces object-oriented best practices and... it's just fun to use!
I want you to feel dangerous with Symfony and love the process! In this tutorial, we get to learn the fundamentals of Symfony, build real stuff and learn the how and why behind how things work. And... we'll do it by building a space-themed site (because I'm a sci-fi geek):
- Create a new (and tiny!) Symfony app (it's lean but mean)
- Set up a local web server with the
symfony
binary - Get your editor (PHPStorm) + plugins primed for Symfony
- Dive into Symfony Flex & the "recipes" system
- Add some 3rd party packages and bundles
- Routes, controllers and Responses!
- The mighty
bin/console
tool - Head-first into Twig & templating
- Your new favorite debugging tool: the web debug toolbar
- Simple, but crazy-powered CSS & JS setup with AssetMapper!
- Install & Running Tailwind CSS
- Intro into Stimulus & Turbo for JavaScript & an SPA (single page app) feel
- Create a JSON API endpoint
- All-important "service objects": a quick tour of using them and creating your own
- Say hello to MakerBundle
Let's boldly go!
Next courses in the Symfony 7: The Fundamentals section of the Symfony 7 Track!
23 Comments
Hey @john-erney-rojas ,
Thank you for your interest in SymfonyCasts tutorials! This course should be the next and we will start releasing it very soon :)
Cheers!
This is the best place to learn how to handle any version of Symfony.
Until now, I am still perplexed, but also happy, by the creation of the Assetmapper component with which it is no longer necessary to use Webpack encore. Will AssetMapper be the final nail in the coffin of node, npm, yarn and Webpack encore?
I don't know what new surprises Symfony 7 will bring, I just hope it brings new game changer features like the AssetMapper component.
Hey @simfonyace ,
That's the plan with the AssetMapper actually! But you know, the programming world is changing quickly :) But AssetMapper really has a big potential to stay on top pretty long.
Cheers!


Hello!
I got trouble setting up tailwindcss in my project. I have added tailiwndcss bundle. initiated it and even used one or two tailwind calasses. But it seems like i canot use all tailwind classes? My tailiwind is rebuilding as i have set up the worker to do it, i have checked everything up and I'm missing something. Any tips please?

Hey @Wiktor-B
Sorry for my late reply. I think Tailwind is purging your classes because it didn't find them at compilation time. Double-check your config and be sure that Tailwind is looking at the right places (also pay attention to dynamic classes, those are hard to find as well)
// tailwind.config.js
module.exports = {
content: [
'./templates/**/*.html.twig',
'./assets/**/*.js',
'./src/**/*.php', // in case you add dynamic classes via PHP
// Add more if needed
],
theme: {
extend: {},
},
plugins: [],
};

Hello,
Thanks for the great work with all your tutorials.
I'm back to Symfony after years and this one is a good starting point to refresh my memory and learn all the innovations.
I've finished chapter 7 at the moment of writing this comment and have a question regarding the command line:
Is there any reason why you're not using « symfony » to run composer and console?
For example:
- « symfony composer require... » instead « composer require... »
- « symfony console... » instead of « php bin/console... »
Particularly in my case with a workstation under Rocky Linux and multiple PHP version from Remi Collet, I think using the Symfony CLI ensure the right one is used, doesn't it?
King regards,
Hey Glouton,
Good question! Yeah, executing console via symfony
binary, i.e. symfony console ...
gives you more advantages as it covers Docker, look at the correct PHP version if you have several installed, etc. So, I would recommend you to execute it via symfony
binary, both symfony console
or symfony composer
commands if you have that installed.
But we don't want to make that symfony
binary a requirement for users who are following our tutorials. Symfony app is always shipped with the console out of the box, so that's the "low-level" thing to use :) But if you have symfony
bin installed - use it instead for running Symfony and Composer commands.
Cheers!
Hi Victor,
Thanks a lot for your quick answer.
It does make sense indeed to show how to use the "original" tools but I was wondering because in chapter one the very first steps are to install the symfony
binary and then use it to create the new Starshop project.
I will continue to call these via the symfony
binary because, on my development workstation, if I call composer require
directly then it throws errors as it uses the default PHP 8.0.3 from the system instead of PHP 8.3.19, even though I've run module load php83
and add a .php-version
file.
Anyway, I thought it might be worth mentioning.
Thanks again.
Regards,
Hey @glouton!
I actually only realized symfony composer
exists - makes total sense. You make some great points. We'll have an internal discussion about standardizing in future tutorials.
Cheers!
Kevin

Hi there,
Now that I've finished this tutorial I just wanted to add that Ryan does mention and use symfony console
at the end.
Thanks again for your awesome work.
Cheers:
Charles
Hi! I see that even if I don't have a subscription to the course however I can follow it, so my question is: is the Github repository of the project accessible also to non paying users like me? If yes, where can I find the link? Thank you in advance.
Hey @Lorenzo!
You should be able to download the course code (top right in the first chapter).
This is the public Github repo for this course but it has some internal stuff that might make it harder to work with. The downloaded course code would be best.
--Kevin
I'm just starting a new web project. And I choose to use Symfony after working on the legacy from scratch project.
A lot to learn. Hope this course will help!
Hey CR,
This course should be perfect for you to get into Symfony Introduction, so you started from the right course! Next, see the Symfony 7 track: https://symfonycasts.com/tracks/symfony7 - or use our advanced search to find more relevant topics you're looking for, or you can always drop us a line for advice about where to go next ;)
Cheers!


I am really enjoying the new user experience you guys have put in place the last few weeks.
Hey @ashapurasoftech ,
Are you talking about our updated design? We're still working hard on it transferring more pages. And thank you for your feedback, our team is really happy to hear it!
Cheers!


Not so much a question, but more a comment - kudos on the new UI! I am really enjoying the new user experience you guys have put in place the last few weeks. Cheers!
Hey Jon,
Thank you for the feedback! We're really happy to hear it :) More redesigned pages are coming soon.
Cheers!


TOP: great courses and very clear instructions. I only program for fun, but I have no problem understanding your tutorials and I learned a lot!
TIP: It feels you're not finishing tutorials before the next big Symfony upgrade where you start from scratch (is that really necessary(?!); Symfony 4 Track: 8 courses; Symfony 5 Track: 5 courses; Symfony 6 Track: 3 courses: Symfony 7 Track: first course announced... Maybe just focus on the differences between the previous and the new version?
TOP: you keep your courses up to date, going into latest developments (like Turbo for instance)
TIP: Symfony 7 goes into SPA, could you also include PWA (Progressive Web App)?
Keep on rocking!
Hey @odds!
Thanks for the nice comment - I appreciate you!
It feels you're not finishing tutorials before the next big Symfony upgrade where you start from scratch
That's super true - and my fault for Symfony 6. We're going to be better for Symfony 7. Unfortunately, we can't just focus on the differences between the versions or point people at a Symfony 6 tutorial and say "this is still relevant". Well, we do that sometimes, but it's not ideal. When people are learning Symfony "7", they really need all the tutorials to be consistent, full & new for that version. That being said, it is a challenge to update all of them. But we're improving some processes internally. We just need to be faster :).
TIP: Symfony 7 goes into SPA, could you also include PWA (Progressive Web App)?
I've been diving into this lately! Expect to see this topic coming up - hopefully with a tutorial - this year. Related PR: https://github.com/symfony/ux/pull/1350
Cheers!


These were the plans, but than your life got turned upside down... How are you now?
Lo Mejor de los Mejores!!!
Can't wait to start this course!