در حال بارگذاری ...

Installer Flags Overview0:00

Alright, next up, we have a couple shortcuts for when you want to generate a new Laravel project that uses Laravel Breeze or even the PEST testing framework. Okay, let's have a look. Now, first up, we should ensure that we have the latest version of the Laravel installer. I can do that by saying composer global update, and we'll give that just a minute. Now, once that completes, I will run laravel help for the new command. And yeah, immediately, you can see a new PEST flag as well as Breeze here. Alright, so let's give it a shot. laravel new, I'll still call it laravel 10, but this time I will add the PEST flag as well as Breeze.

Creating Project with Breeze0:37

Laravel, new, I'll still call it Laravel 10, but this time I will add the -pest flag as well as Breeze. Okay, so now we have this nice CLI for Breeze. Which stack do you prefer? Usually Vue for me, but I will stick with Blade. Would you like to install dark mode? No. Alright, and let's give that just a minute. Alright, there we go. Let's cd in there and open this in my editor.

Verifying Pest Tests0:59

Alright, there we go. Let's cd in there and open this in my editor. Okay, so now if I open my test directory, sure enough, we are using PEST. And if, for example, I look at a feature test, yeah, it's not going to take the traditional PHPUnit class style. It now has a more JavaScript-like syntax, which many people prefer, including myself. Okay, now let's view this in the browser. And there we go. We still see the usual splash page, but now a little hint that Laravel Breeze has been installed.

Configuring SQLite and Migrate1:29

We still see the usual splash page, but now a little hint that Laravel Breeze has been installed. Let's try it real quick. I will open up my .env file and let's use SQLite and the default database. So I will delete that. Okay, so now I can migrate my database, excuse me, php artisan migrate. And now here's another little addition in recent months. If you have not yet created the SQLite file, it will do that for you. Would you like us to create it? Yes, please.

Registering and Logging In1:59

Would you like us to create it? Yes, please. Alright, so why don't we go ahead and register a new account for John Doe, john@example.com. And there we go. We're now signed in. I mean, come on. Don't take it for granted. But this is so cool. Think about what we were able to do and accomplish in a matter of seconds. We installed a brand new Laravel 10 project.

Recap and Laravel Ethos2:16

Think about what we were able to do and accomplish in a matter of seconds. We installed a brand new Laravel 10 project. We pulled in Pest. We installed Laravel Breeze. We whipped up a database on the fly. We registered John Doe. We logged him in. And again, it took seconds. And you know what? In Laravel 9, that whole process was really quick.

And you know what? In Laravel 9, that whole process was really quick. But in Laravel 10, it's just a little bit quicker. And I don't know, isn't that the ethos of Laravel? To take things that are just a little bit cumbersome and then make them not cumbersome. I love things like this. Alright, let's move on to the next episode.

Pest ScaffoldingLaravel Breeze Scaffolding

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟