Introducing JetStream Installer0:00
Now, JetStream is pretty crazy. Have a look. If we look at the new command on the latest release of the installer, we have a --jet flag, a --stack flag, and a --teams flag. So JetStream is application scaffolding at its finest. Now for stack, that refers to something like Livewire or Inertia, different modern ways of building applications. Okay, so let's have a look. Install new JetStream. I'll add that --jet flag to include the scaffolding.
Installing JetStream Stack0:28
Install new JetStream. I'll add that --jet flag to include the scaffolding. I'll set the stack to Livewire, and if I even wanted team support, I could add that as well. But let's leave that off. We'll give it a moment. There we go. We're all set up. So do notice we need to install our development dependencies. So let's cd in there and run that. And we're all set.
Exploring Generated Scaffolding0:47
So let's cd in there and run that. And we're all set. Okay, let's have a look. Okay, so right off the bat, if we have a look at your resources/views directory, we'll immediately see some new things here. A dashboard, profile page, some layouts, some auth, scaffolding. Next, in your routes file, we can also see a new route here for our dashboard. So let's try to run it in the browser, but I don't think it's quite ready yet. We run it, and sure enough, unknown database. Okay, so let's set up our environment settings.
Configuring Database and Migrating1:13
We run it, and sure enough, unknown database. Okay, so let's set up our environment settings. By default, it's looking for this database. So let's go ahead and do that now. Create database called Jetstream, or whatever you want. And then I can go ahead and migrate the database. So if we come back and give it a refresh, we're all set. So it looks like the normal landing page, but you will see this login and register link. Let's go ahead and register myself. Run it, and we're in.
This one will do. Save it, and we're ready to go. Just like that. What else? We have our password details. You get the basic idea. So it's far beyond the scope of a what's new episode to dig into this, but rest assured, we'll make a full series at Larikast to show you the ins and outs of JetStream, as well as how you can learn from it. So to finish up, let's just have a look at one section here, like updating the password.
Publishing JetStream Views2:24
as how you can learn from it. So to finish up, let's just have a look at one section here, like updating the password. All right, well, if I go back to that routes file, let's see if we can find it. Dashboard, and let's have a look. All right, and we can see a bunch of components here. We have a JetWelcome. But yeah, again, if I look, where is that? I don't see it anywhere. Well, these are included with the JetStream package, but you can import it if you want. Like this, php artisan vendor:publish, and we're going to look for JetStream views.
Well, these are included with the JetStream package, but you can import it if you want. Like this, vendor:publish, and we're going to look for JetStream views. And in fact, while you're here, take a look at everything you can publish if you wish. For now, just 23 will do. Okay, so now, let's take a look at our vendor/JetStream directory. Here we go. So if we're looking for welcome here, there it is. There's your welcome page. Return to the dashboard, and there you go. We've updated it.
Tracing Password Update Flow3:20
Return to the dashboard, and there you go. We've updated it. But anyways, in our case, we were looking for the profile password section. Now, if we were to view php artisan route:list, I have to zoom out. But if we look for profiles, there it is. So this endpoint takes us to the view profiles.show, and then there's a UserProfileController. All right, let's have a look. ProfileShow, and here we go. So now, we can see we requested the Livewire stack, so it's using that, and it's delegating to an updatePasswordForm component.
So now, we can see we requested the Livewire stack, so it's using that, and it's delegating to an updatePasswordForm component. And again, you'll find this in your views/profile directory, updatePasswordForm. Okay, and this is it. So you get these components for free to match the styling of the site. And you'll see, because it's using Livewire, when you submit this form, it's not performing a full postback. Instead, it's hitting the updatePassword method on the Livewire component. Let's have a look. UpdatePasswordForm, and there it is.
Let's have a look. Update password form, and there it is. So there's the method. And again, this is all happening as part of an AJAX request. So it updates the User using an action that I'll show you. It clears the state, and then it emits an event, which ultimately means this all happens seamlessly. So the last thing I'll show you, just to give you a quick head start. Your actions directory is where most of these operations will happen. That way, you can control it if you want.
Your actions directory is where most of these operations will happen. That way, you can control it if you want. So there's your JetStream action, and then one for Fortify. So here is updateUserPassword. So you'll notice all of this is divided into actions, if you like that approach. In this case, we'd update the User by validating the request. And then if that passes, we update the User with the hashed version of what they provide. And that's it. We come back. I think that's it.
