Setting Up Laravel 100:00
OK. Hi, everybody. Guess what? It's a new year, so, of course, we also have a new major release of Laravel. OK. So, as of February 14th, Valentine's Day, 2023, Laravel has officially bumped to version 10. And, of course, I'm here. My job is to get you up to speed on everything you need to know. OK. So, without further ado, let's just jump right in. OK. So, if I open Visual Studio Code, you can see that I have a fresh install of not Laravel 10, but Laravel 9. OK. So, we will use this to compare and contrast the differences between each version of the framework. OK. So, that means I need a fresh copy of Laravel 10, and I will call it Laravel 10 just to make it crystal clear. And sure enough, you can see, installing Laravel version 10.0. All right. Let's cd in, and I will open this version in PhpStorm. Very cool. All right. So, why don't we begin nice and simply? If we have a look in the
Native Types Overview0:53
installing Laravel version 10.0. All right. Let's cd in, and I will open this version in PhpStorm. Very cool. All right. So, why don't we begin nice and simply? If we have a look in the browser, here is the welcome page for Laravel 9, and it looks good. However, if I switch over to Laravel 10, we still have the same dark aesthetic. But, yeah, it's just been cranked up a notch, and I think it looks really good. OK. So, let's switch back and discuss native types as part of Laravel 10. OK. So, if we have a browse here, let's go into app, console. How about the ConsoleKernel? You'll notice that wherever possible or practical or non-breaking, Laravel has added types and return types, and they've also updated the doc blocks to remove any superfluous declarations. So, for example, here, we are typing schedule, so it doesn't really make sense for Laravel to also do something like this. OK. So, let's have a look. We're in the Kernel class. If I switch over to
Docblocks and Typing Changes1:47
So, for example, here, we are typing schedule, so it doesn't really make sense for Laravel to also do something like this. OK. So, let's have a look. We're in the Kernel class. If I switch over to Visual Studio Code, where I'm still using Laravel 9, let's have a look at the ConsoleKernel. And, yeah, notice the difference here. So, yes, they were typing schedule, but they were also re-declaring it within the doc blocks. So, yeah, as you can imagine, as part of this PR, Nuno basically had to update every single Laravel repository to add all of the missing types and then update the doc blocks, and then he also made some slight tweaks to converting old anonymous functions to short closures and things like that. So, yeah, as you can imagine, it's basically a process of, OK, well, we have a type here, so this is redundant, and then we have a void return, so let's declare it there and then update this like so. So, if I were to do that and then switch
