Chapters
27 Chapters
|
2:45:18
|
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!
01.
The Answer Entity
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!
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"babdev/pagerfanta-bundle": "^3.3", // v3.3.0
"composer/package-versions-deprecated": "^1.11", // 1.11.99.3
"doctrine/doctrine-bundle": "^2.1", // 2.4.2
"doctrine/doctrine-migrations-bundle": "^3.0", // 3.1.1
"doctrine/orm": "^2.7", // 2.9.5
"knplabs/knp-markdown-bundle": "^1.8", // 1.9.0
"knplabs/knp-time-bundle": "^1.11", // v1.16.1
"pagerfanta/doctrine-orm-adapter": "^3.3", // v3.3.0
"pagerfanta/twig": "^3.3", // v3.3.0
"sensio/framework-extra-bundle": "^6.0", // v6.2.1
"stof/doctrine-extensions-bundle": "^1.4", // v1.6.0
"symfony/asset": "5.3.*", // v5.3.4
"symfony/console": "5.3.*", // v5.3.7
"symfony/dotenv": "5.3.*", // v5.3.7
"symfony/flex": "^1.3.1", // v1.21.6
"symfony/framework-bundle": "5.3.*", // v5.3.7
"symfony/monolog-bundle": "^3.0", // v3.7.0
"symfony/runtime": "5.3.*", // v5.3.4
"symfony/stopwatch": "5.3.*", // v5.3.4
"symfony/twig-bundle": "5.3.*", // v5.3.4
"symfony/validator": "5.3.*", // v5.3.14
"symfony/webpack-encore-bundle": "^1.7", // v1.12.0
"symfony/yaml": "5.3.*", // v5.3.6
"twig/extra-bundle": "^2.12|^3.0", // v3.3.1
"twig/string-extra": "^3.3", // v3.3.1
"twig/twig": "^2.12|^3.0" // v3.3.2
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.3", // 3.4.0
"symfony/debug-bundle": "5.3.*", // v5.3.4
"symfony/maker-bundle": "^1.15", // v1.33.0
"symfony/var-dumper": "5.3.*", // v5.3.7
"symfony/web-profiler-bundle": "5.3.*", // v5.3.5
"zenstruck/foundry": "^1.1" // v1.13.1
}
}
19 Comments
I'm trying to update my code that I've already created from previous S6 tutorial videos to align with the changes made ahead of this series to include stimulus and webpack encore. I believe I've added all of the dependecies I need and am running npm run watch to watch and bulid my webpack for my site. However, I'm getting the below error. I'm not familiar enough with nodejs to understand. Is it saying I'm missing webpack-encore? I've previously run composer require symfony/webpack-encore-bundle so that shouldn't be it. Also ran npm install encore just to be sure and am still getting the same issue.
`
root@2236ca7d93cd:/var/www/symfony_docker# npm run watch
node:internal/modules/cjs/loader:959
throw err;
^
Error: Cannot find module '../lib/config/parse-runtime'
Require stack:
at Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1022:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/var/www/symfony_docker/node_modules/.bin/encore:13:22)
at Module._compile (node:internal/modules/cjs/loader:1120:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
at Module.load (node:internal/modules/cjs/loader:998:32)
at Module._load (node:internal/modules/cjs/loader:839:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/var/www/symfony_docker/node_modules/.bin/encore' ]
}
Node.js v18.6.0
`
<b>UPDATE</b> I finally gave up trying to figure this out and just downloaded the sample file package, deleted my previous work, and started from the start directory. After running composr install, npm install and npm update, npm run watch is now working. I'm still curious on what this was if anybody has any thoughts.
how to update this code to symfony 6.2?
Hi,
But why do you want to upgrade it? Upgrades are easy, you can learn about them for example here https://symfonycasts.com/screencast/symfony6-upgrade
But if you upgrade this code to 6.2 probably you will get lot of issues in next chapters 'cause not everything can be supported
Cheers!
Hi
I think you forgot to put
$answer->setCreatedAt(new \DateTime('now'));
$answer->setUpdatedAt(new \DateTime('now'));
Hello, thank you for great work. But I have problems with the installation. I am using postgres and I get blocked by sql errors while doing the migrations. Any quick solution?
Hey Steb!
Oh, yeah... our migrations are created for MySQL server, you can see it when open any migration. If you want to use a separate DB server - you would need to re-create those migration for your DB server. But the quick solution would be to do not use our migrations at all and instead execute:
bin/console doctrine:database:create
bin/console doctrine:schema:update --force
This will create the DB schema from scratch, but keep in mind that you may lose some data if you already have a DB with good data, but if no good data in your DB or you don't care if some information will be lost - then great.
Another solution would be to recreate all the migrations from scratch, you need to drop the DB, then create a new empty one, and run "bin/console make:migration" that will create a migration for your DB server. Then just migrate like we do in the README.
Cheers!
Thank you Victor ! I should have thought about le --force option. It worked great !
Hey Steb,
Perfect! Yeah, creating schema via "doctrine:schema:create" command or using "doctrine:schema:update" is a good trick locally :) Migrations in turn are mostly needed for production.
Cheers!
Thank you for all the amazing work. One question I had is how do we use php8 attributes to replace Gedmo annotations? I switched doctrine's config to use attributes instead of annotations and replaced all the ORM annotations for the Question entity, however I am not sure how that works for the Gedmo extension. Also, is there a way to regenerate entity classes with attributes instead of annotations :D
Hey Sajeev N.
Unfortunately Gedmo is not ready for PHP8 attributes =( There is a pull request to add support, but it's still a draft https://github.com/doctrine...
So you have 2 choices:
1. do not use attributes until gedmo updates
2. do not use gedmo and add everything you need manually (sometimes it's not to hard)
Cheers!
Hello SymfonyCast Team - once again my big gratitude for your work! Amazing tutorial!
With you're huge help I have managed to finished my studies and my ecommerce project - and finally I got employed as a junior php dev.
THANK YOU SYMFONYCAST ❤️
Hope you will continue your awesome work!!
I have an of topic question - maybe you could suggest any tuts/resources besides documentation for Sylius, as for begginers.
Would really appreciate it. :)
Hey Andrejus.
Congratulations! You made our day ;) And good luck with your job as PHP dev!
We're going to release a course about Sylius some day, but not plans to release it in the near future, sorry! Also, I don't have any specific recommendations unfortunately, but I bet you may find something on the internet. Also, the best friend is always docs, so make sure to check it as well: https://sylius.com/ . And looks like they even have their own online course about it: https://sylius.com/online-c... - but I can't tell you anything about it.
Cheers!
Thank you for amazing tutorial! You are perfect there !
Q: Where is link to Doctrine part 1? Or it is mean Symfony 4 course?
P.s. Something happend with your voice, too tired or after Covid....
Hey Mepcuk!
Ah, I'm so happy you're liking it! ❤️
> Q: Where is link to Doctrine part 1? Or it is mean Symfony 4 course?
Yup, it's the Symfony tutorial with Doctrine - so, this one: https://symfonycasts.com/sc...
> P.s. Something happend with your voice, too tired or after Covid
Oh man, I didn't realize! Hopefully it's temporary - I don't have a cold or illness at the moment... so I'm not sure what might have happened. Well, my son HAS been missing a TON of school... so maybe it's just tired ;).
Cheers!
Hello!
Just to say thanks a lot for the new videos. Keep up the incredibly work, we appreciate <3
Hey Production P.
Thank you so much for the feedback <3 We appreciate it so much! Keep learning and enjoy videos :)
Cheers!
I glad to see new video for Doctrine. Thnak you! ;)
BTW, if it possible , Could you add pause/unpause functionality video for toch screens? I mean , like for desctop PC, when I can click in the middle of video frame. For Desktop PC I see big "Play" button, for my iPad no. May be I'm wrong and it's related with Safary only.
Hey Ruslan,
Thank you one more time for this suggestion! It was just implemented by our friend @sadikoff and should be available on production from now on :) Please, give it a try and feel free to share your feedback with us if you want ;)
Cheers!
Hey Ruslan!
Ah, I see that! That's annoying! We'll see if we can make this better for you - and I'm happy that you're happy about the new videos!
Cheers!
"Houston: no signs of life"
Start the conversation!