Chapters
24 Chapters
|
1:14:57
|
Login to bookmark this video
-
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!
Subscribe to jump to this part in the video!
This tutorial works perfectly with both Symfony 7 & 8!
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
}
}
6 Comments
Make sure you haven't left the line in the AppFixtures that creates 50 parts - took me all afternoon to work out this was making the load fail.
Hey @alimack ,
Thanks for this tip!
Cheers!
Hi, in Windows 10 and docker engine $part->setStarship($starship); not work.
Error
An exception occurred while executing a query: SQLSTATE[42703]: Undefined column: 7 ERROR: column "starship_id" of
relation "starship_part" does not exist
LINE 1: ...part (name, price, notes, created_at, updated_at, starship_i...
The first line in StarshipPart table does not exist
Hey @giorgiocba
Sorry for my late response. I believe you didn't update your database after adding the
starshiprelationship. Could you take a look?Cheers!
When you do :
I cannt see part_id is 1.
Even when I try to do the query myself, I dont see part_id anywhere... Did I miss something?
Hey Bart,
You may have a different ID locally, depending on how many times you reloaded your fixtures. First of all, make sure you reloaded the fixtures. Then, you can find the correct ID with this command:
And finally use the ID from the output in that last command:
If you still don't see it - make sure you have the exact same code in
AppFixtures.phpas on the video, probably you missed theflush()call there?. You can expand the full code block here: https://symfonycasts.com/screencast/doctrine-relations/setting-relation#codeblock-e528363598Cheers!
"Houston: no signs of life"
Start the conversation!