Introducing Jetstream Features0:00
Okay, let's take a look at Jetstream. Jetstream is a beautifully designed application scaffolding that's a great starting point for your Laravel apps. It's built on top of Tailwind CSS, some Alpine.js for JavaScript, and it includes features like logging in, registration, profile management, two-factor auth, session management, API tokens, and teams. You also have two stacks to choose from, either Livewire or Inertia, which are both great. In this series, we'll go over all of the different features, and in this video, we'll take a look at installation and a high-level overview of all of the different features that I just mentioned.
Jetstream vs Fortify0:32
take a look at installation and a high-level overview of all of the different features that I just mentioned. Also note that there's another underlying package being used called Laravel Fortify. So Fortify is where all of the logic for logging in, registering, and two-factor auth goes. Think of Jetstream as the front-end portion, so all of the Blade views, Livewire, and Tailwind CSS, and think of Fortify as the back-end portion where all of the auth logic goes. We'll also take a look at using Fortify on its own. So let's go ahead and install Jetstream and take a look around. So if you don't have a Laravel project yet, you can use the Laravel installer and do laravel new project name --jet.
Installing Jetstream with Livewire1:08
So if you don't have a Laravel project yet, you can use the Laravel installer and do laravel new project name --jet. But in this case, I already have a project, so let's composer or acquire it. Okay, and now let's make use of Livewire here, and let's add Teams as well so I can show you that. So let's add Teams. And now we just have to install the JavaScript dependencies, so mostly just Tailwind here. Okay. Okay. Okay, that's done.
Okay. Okay, that's done. Let's migrate our database. And now everything should be installed, so if you take a look at our app, we have login and register up here, and just as you expect, we should be able to fill this out and create a new User and login, so let's do that. So let's make a User for myself, and this should log us in as expected. Why is that not working? Let me just php artisan migrate:fresh --seed everything again, so I'm just going to run this command, which is php artisan migrate:fresh --seed, and let's try this again.
Enabling Jetstream Configuration2:19
Let me just migrate:fresh everything again, so I'm just going to run this command, which is php artisan migrate:fresh --seed, and let's try this again. And hopefully it works this time. Okay, so it did. So let's take a look at all of the features available to us. Actually, before I do that, let me go into the config/jetstream.php file and turn on all the features. So there is a config/jetstream.php here, and let's enable these two as well. There's also a config/fortify.php file, which has some options as well, as you can see here. And the only one that's commented out is email verification for registration, which we'll just leave for now.
Exploring Profile Management2:56
And the only one that's commented out is email verification for registration, which we'll just leave for now. Okay. And if I go back here and refresh, we should see a bunch of options here. So the first one is the profile. So a profile where you can update your name and your email and your password is something you always have to build whenever you're making a new application. So it's great that Jetstream has this by default. So these are Livewire components. So if I make edits here, it does not do a full page refresh as Livewire makes use of.
So these are Livewire components. So if I make edits here, it does not do a full page refresh as Livewire makes use of Ajax requests. So if I save this, you'll see that saves it and we don't have a full page refresh. So same thing for password. I don't think I have to demo that. Obviously there's validation here as well. And a section for profile photo if you want to add that. So let's add a picture of myself here and you see that it updates here. And also let me save this first actually.
API Tokens and Sanctum7:44
Okay. What's next up here in the menu? We have API tokens. So this lets third party services authenticate with our application on your behalf. So a good example of something using this is Laravel Forge if you use Forge. So within the Forge dashboard, you can do different things like creating new servers, adding sites and so on. But if you want to do that within your own app, say a mobile app, then you would have to make use of Forge's API. And in order to do that, you need to generate a token from within your Forge dashboard.
Teams Setup and Invites8:08
to make use of Forge's API. And in order to do that, you need to generate a token from within your Forge dashboard. So same thing applies here. And we'll take a look at this in another video. And also this is making use of Laravel Sanctum. What's next? Next is Teams. So if you have Teams enabled, then it will create a team for you whenever you create a new account. As you see, I have one here.
a new account. As you see, I have one here. And you can add members, but that member already has to have an existing account. So let's go ahead and do that. So I'm going to use Firefox again, make a new User. And let's just make one here. Okay. So let's register this new User. And now let's invite this User to my team here. So user@user.com.
And now let's invite this User to my team here. So user at user.com. And there's also roles here, which you can customize within the code. So let's just say admin, add that user. And you can see a list of the users here. And now within this User, they should belong to two teams. So I should have my team, which I'm currently signed in as. And I can switch to this other team as well and have a whole new set of information show here depending on the team that you're currently selected. So if you ever use Stripe before, it's very similar to that where you can see different
Password Reset Flow9:59
all of the auth packages. Let me just show you this real quick. At least the email being sent out. So I'm going to send to the or set the email driver to log. And let's put in my email here. So email the reset link. Okay. And there should be a new email here. There's a Laravel log. The email should be somewhere down here.
There's a Laravel log. The email should be somewhere down here. There it is. Let's go ahead and reset our password. And this should work properly. Okay. And we can change our password here. So again, all standard stuff, which is all included within Laravel Jetstream. So yeah, in the next few videos, we'll take a look at how to customize the different features if you want to do that.
