Chapters
-
Course Code
Subscribe to download the code!
Subscribe to download the code!
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Subtitles
Subscribe to download the subtitles!
Subscribe to download the subtitles!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
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". Unfortunately, I'm not all better & sure, I type with one hand, like a Symfony pirate. But but dang, I missed you all and I missed Symfony. And today is a good day. Thank you for the support, love & patience. Now, to business!
In the previous tutorial, we did some impressive stuff. We crafted an entity, set up migrations, created fixtures and queried like SQL nerds. But let's face it, we can't build anything that will impress our friends or grandma without understanding database relationships. For example, "this pizza slice belongs to me" or "I have a lot of pizza slices." Mmm, I like pizza.
To fully warp your relations game, download the course code from this page. Once you've unzipped it, you'll find a start/
directory with the code you see here. Check out the handy README.md
file for all the setup goodies. The last step will be to fire up a terminal, navigate into the project, and run: symfony serve
. Sometimes I run this with a -d
, so it does its thing in the background. But today, I'll run it loud & proud in the foreground.
symfony serve
Oh Hi There Server and Tailwind Logs
One useful side effect of running in the foreground is that we get to see all the logs, though you can see these anytime by running symfony server:log
. This project uses Tailwind CSS and you can see it downloading Tailwind and building in the background. Once that's done, I'm going to scroll up and click the link to launch our app: Starshop!
Introduction to Starshop
Starshop is all about repairing ships, a one-stop solution for all your spaceship woes because nobody wants to float through intergalactic space with a broken shower. Gross. All these starships are coming straight from the database. If you navigate to src/Entity/
, you'll find our one shiny entity: Starship
.
Show Lines
|
// ... lines 1 - 10 |
#[ORM\Entity(repositoryClass: StarshipRepository::class)] | |
class Starship | |
{ | |
use TimestampableEntity; | |
#[ORM\Id] | |
#[ORM\GeneratedValue] | |
#[ORM\Column] | |
private ?int $id = null; | |
#[ORM\Column] | |
private ?string $name = null; | |
Show Lines
|
// ... lines 23 - 137 |
} |
Next Steps: Tracking Ship Parts
It's time to spice things up by tracking the parts of a ship & their cost. Then we'll assign each part to a ship in the database.
13 Comments
Thank you @Braunstetter ❤️. I'm happy to be "heard" again


Ryan! It's so awesome to hear your voice in a new video! I was hoping you could tell me something about your PhpStorm setup. About 1 minute in, how do you get those icons?


I followed the project installation instructions step by step, but when I check out the site at https://localhost:8000
, the following error occurs:
An exception occurred in the driver: could not find driver
Doctrine\DBAL\Exception\ DriverException
Show exception properties
in C:\Proyectos\relations\vendor\doctrine\dbal\src\Driver\API\PostgreSQL\ExceptionConverter.php (line 85)
if (str_contains($exception->getMessage(), 'terminating connection')) {
return new ConnectionLost($exception, $query);
}
return new DriverException($exception, $query);
}
}
Hey @giorgiocba,
Let's figure this out!
I think you don't have the postgres PHP extension installed/enabled. I see you are in Windows - how did you install PHP?
If you run symfony php -m
, this lists your enabled PHP extensions, do you see any that start with pdo_
?
--Kevin


only the 5th to welcome you back ... ryan. we missed u a lot. welcome back and i hope you can recover at least to 99%. kevin did his job good, but there is no humor like yours.
har har har ... (onehanded spacepirate greetings) from germany 🛸
Hey @Ek24!
har har har ... (onehanded spacepirate greetings) from germany 🛸
Well I freaking love this! Who else gets a onehanded spacepirate greeting from Germany?
Thanks for the nice message & cheers!
Hey Ryan, very welcome back 🙌🙌
It is always great to have you 💪💪💪
Thank you @john-erney-rojas!
It feels like a homecoming 🥳
So glad to hear you again Ryan ❤️
Thank you! It'd good to be "heard" again ;)

"Houston: no signs of life"
Start the conversation!
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"babdev/pagerfanta-bundle": "^4.5", // v4.5.0
"doctrine/dbal": "^4", // 4.2.3
"doctrine/doctrine-bundle": "^2.13", // 2.14.0
"doctrine/doctrine-migrations-bundle": "^3.3", // 3.4.1
"doctrine/orm": "^3.3", // 3.3.2
"knplabs/knp-time-bundle": "^2.2", // v2.4.0
"pagerfanta/doctrine-orm-adapter": "^4.7", // v4.7.1
"php-cs-fixer/shim": "^3.46", // v3.73.1
"phpdocumentor/reflection-docblock": "^5.3", // 5.6.1
"phpstan/phpdoc-parser": "^2.0", // 2.1.0
"stof/doctrine-extensions-bundle": "^1.12", // v1.13.0
"symfony/asset": "7.2.*", // v7.2.0
"symfony/asset-mapper": "7.2.*", // v7.2.3
"symfony/console": "7.2.*", // v7.2.1
"symfony/dotenv": "7.2.*", // v7.2.0
"symfony/flex": "^2", // v2.5.0
"symfony/framework-bundle": "7.2.*", // v7.2.4
"symfony/http-client": "7.2.*", // v7.2.4
"symfony/monolog-bundle": "^3.0", // v3.10.0
"symfony/property-access": "7.2.*", // v7.2.3
"symfony/property-info": "7.2.*", // v7.2.3
"symfony/runtime": "7.2.*", // v7.2.3
"symfony/serializer": "7.2.*", // v7.2.4
"symfony/stimulus-bundle": "^2.13", // v2.23.0
"symfony/twig-bundle": "7.2.*", // v7.2.0
"symfony/ux-turbo": "^2.13", // v2.23.0
"symfony/yaml": "7.2.*", // v7.2.3
"symfonycasts/tailwind-bundle": "^0.9.0", // v0.9.0
"twig/extra-bundle": "^2.12|^3.0", // v3.20.0
"twig/twig": "^2.12|^3.0" // v3.20.0
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^4.0", // 4.0.0
"symfony/debug-bundle": "7.2.*", // v7.2.0
"symfony/maker-bundle": "^1.52", // v1.62.1
"symfony/stopwatch": "7.2.*", // v7.2.4
"symfony/web-profiler-bundle": "7.2.*", // v7.2.4
"zenstruck/foundry": "^2.2" // v2.3.8
}
}
What a surprise! I'm so happy to hear your voice again, Ryan – that really made my day. I'm going to enjoy every moment of this new course!