Customize Laravel Starter Kits with Fortify
Chapters10
Overview of how starter kits provide authentication and scaffolding that can be tailored to fit your app.
Laravel starter kits can be customized end-to-end, from Fortify-backed auth to frontend tweaks, without losing the starter’s quick-start benefits.
Summary
Kris from Laravel demoes how the starter kits are more than fixed templates. They’re built on Fortify and now run on a Laravel 45 backend, giving you authentication, password resets, two-factor auth, and more with flexible front-end options. He shows how to tweak config in config/fortify.php to redirect after login, enable/disable features like registration or email verification, and even override login behavior in a service provider. The video walks through adding a username field to registration, updating the backend create-user action, and adjusting the frontend blade/components to login with a username instead of email. Live examples include enabling/disabling features, turning off password reset links, and testing email verification flow. Kris also demonstrates how to customize the home path and how to reflect these changes in the UI and routes. The core message is clear: starter kits jump-start your app, yet you stay in full control to tailor authentication and UX to your needs. If you want a ready-to-run but fully adjustable auth foundation, this is a practical guide.
Key Takeaways
- Fortify features can be toggled directly in the Fortify config (e.g., enable/disable registration and password reset) to match your app's needs.
- The video demonstrates redirect behavior customization by changing the home/dashboard path in config and via a login response override in the AppServiceProvider.
- You can extend the user model and database (e.g., add a username column) and wire it into the Fortify actions (App\Actions) and registration blade, with front-end fields updated accordingly.
- The login field can be changed from email to username by updating Fortify's login username configuration and corresponding login blade inputs.
- Service provider overrides allow post-login routing changes and custom logout behavior without altering the default Fortify stack.
- Email verification and two-factor authentication can be enabled/disabled in Fortify config and reflected in the UI and routes.
- The starter kits use a Laravel Frontend-agnostic stack (referred to as 45 in the video) that keeps backend logic consistent while allowing frontend flexibility.
Who Is This For?
Essential viewing for Laravel developers who want to tailor Fortify-powered starter kits to their app’s authentication flow, UI, and user model without losing the quick-start benefits.
Notable Quotes
"Starter kits customized. Lava ships with three amazing starter kits, and most people know them as a quick way to get authentication and front-end scaffolding in place, but they're not just fixed templates."
—Opening statement establishing that starter kits are flexible, not fixed templates.
"So all of our starter kits are now using level 45 under the hood which is our yeah front end agnostic."
—Introduces the backend/frontend-agnostic stack powering the starter kits.
"And you can just do this as well. So back here, let's give this a try."
—Demonstrates changing login redirect behavior via config and trying it out.
"Let's copy this one. Next to the name, we're also going to provide now the username."
—Shows how to add a username to the registration flow and backend actions.
"We can change this to another field from our users table which is username."
—Explains configuring Fortify and login to use a different field (username) instead of email.
Questions This Video Answers
- How do I customize Fortify features like registration and password reset in Laravel starter kits?
- Can I use a username instead of email for login in Laravel Fortify starter kits?
- How do I override Fortify login and logout responses in a Laravel app?
- What is Laravel 45 and how does it affect starter kit frontend/backend integration?
- How can I add a custom field (like username) to the Laravel Fortify registration flow?
LaravelLaravel FortifyStarter KitsFortify ConfigFrontend Agnostic Stack / Laravel 45User Model CustomizationRegistration CustomizationTwo-Factor AuthenticationEmail VerificationAppServiceProvider customization
Full Transcript
Starter kits customized. Lava ships with three amazing starter kits, and most people know them as a quick way to get authentication and front-end scaffolding in place, but they're not just fixed templates. There's a lot you can customize from authentication powered by Fortify, but also to other parts of the stack, so they fit your app much better. In this video, I show you a few practical ways to make Laval starter kits your own. I do have here a new Laval starter kit application. And I've installed this one with the livewire stack. And as you already know, our starter kits bring you a lot of features out of the box that you probably need for all your applications.
So you probably need to register and to log in. For example, I have already account here. You get here dashboard. You have here some settings that you probably need and yeah, a lot of things that you probably need for most of the applications you already get with our starter kit so that you can focus on your next idea. So we want to give you a state of an application that you can easily start with but we also want to give you something that you can customize to your needs so that you can really make it your own application.
And one of the things that we did in order to yeah give you a little bit more flexibility was by integrating laral 45 under the hood. So all of our starter kits are now using level 45 under the hood which is our yeah front end agnostic. Here it says frontend agnostic authentication backend. So it provides you with a lot of features on the back end that you need for log in, log out, password reset, two factor authentication, and many more. And since we're now using 45 under the hood, this also gives you a lot more flexibility in order to change a few things.
And today I'm going to show you some of them. Inside the application, you will find this 45y config file which you find under config. And here are a few things for you that you can customize in order to make the app a little bit more behave like you want to. So in a very simple one, for example, we have already right up here. Let me show this to you. Yeah, this home path here. So when you get logged in, we're automatically redirecting you to the dashboard. But if you don't want this, if you want to go back to the home page, for example, or to the main page, you can just do this as well.
So back here, let's give this a try. We are going to log in again. And as you can see, we are logged in. We see this dashboard button here because we can go to the dashboard, but redirected we were to the homepage. And then the next main thing that you should take a look at in this config file here is a little bit down here. Where do we have it? Here the features. So Fortify comes with a lot of features and you see some of them are already enabled here for if you like users to register then you um you will have to keep this but if you don't want this you can get rid of this and back inside our application if we are now refresh you can see we can log in but we don't can register and if we're trying to go to the page manually you will also see that this is now included anymore which is really nice because you don't want to just get rid of it from the from that We want to just remove it also from the back end.
And this is what you can easily do. Now, another thing, for example, reset passwords. Let's go here. You can see we have here this link. If you forgot your password, you can ask for a new one. And of course, we can just get rid of this. And now you don't see this link anymore. This is just gone. So, that's a very easy way to just customize some of those main features from Fortify to your exactly needs. You will also see that we have email verification already enabled here. But it's not fully yet working because inside our user model.
We have to implement here must verify email. So let's give this a try. Now if I try to log in now and go to the dashboard, you can see that I need to yeah activate my account through the email which I just got sent here to my local email client here in this case. But yeah, this is how you can fully enable it or if you don't need it, you can just disable it again. And the same goes for two-actor authentication for example. Let's get rid of this again here and refresh. Let's get back in here.
Yeah. So under settings, we also have here under security, I have to provide my password again in order to access this. Under security here, we can enable two factor authentication by default. If you don't want this, you can disable the feature again. But yeah, these days it's a very good idea to have this here for your users. And I already mentioned that here in the 45 config file, you can also change the home path here. But if you need a little bit more flexibility in how this works, you can also do this inside a service provider.
So let's go to the app service provider. And here in the register method, let's bring this in. So here you can see so we are registering um a new instance. So by the way we're overriding here this new login response instance which is a contract with a new class here that implements login response. And we are just kind of overriding only the two response method. And here we're saying after login we should go to the dashboard. Remember inside a config file I said it should go to the homepage and inside this two response method we can notify any logic any other logic that we might hear like storing something to the database how many login we have and something similar okay let's give this a try logging out here let's log in again and we should get to the dashboard now and we do because we have successfully overwritten this and you will also find some more information about this on the 45 docs here but this also works there's also log out response.
Yeah, which you can do as well. Just change this to the log out response and then you can change this there as well. But now that's something else. Let's think about the registration process and maybe want to change this and maybe just adding a field here. So in our case, let's add a username field. So two things that we need to change on the front end and then on the back end. On the back end, it's good to know that under app actions, 45 actions are being used here to create the user and to reset the user password.
So, we can change this here in the create new user action here. What are we going to provide? So, let's copy this one. Next to the name, we're also going to provide now the username. Let's use this here. And I think this should it on the back end side. All right. And then also we have here under resources views pages. This is a little bit different depending on which starter kit you're using. I'm using the one with live rar here. So we have here blade component for registration. All right. And we're using flux here by default.
And here we have the name input. And let's bring another one for the username. All right. Here we go. Flux input username. Mhm. Mhm. Type text required autocomplete. Okay, this is looking fine. I also already have inside my user username in my fillable array and I also have this field inside the database on my users table. So let's give this a try here. Name Kristoff username. Kristoff frumple is my username. christofftesting.com and my super secret password. All right, let's create an account. Okay, this is looking good. We are in. And if I go back here now, let's check out have I set up my database.
I don't think so. So, we're going here to database SQLite here in PHP Storm. I'm going to enable this one here. And then we should see here, let's get rid of this under users. I have now this new user. And we should see I think at the end a new field, username. And now we also have this username field here. And we've successfully customized the registration process. And you have seen it wasn't really that difficult. But of course, currently we're still logging in via the email and the password. But yeah, if you want, we can change this too.
So let's go back inside of Fortify config file. Let's scroll a little bit down here. Yes, here we have those two fields where we define what we want want to use for the username in order to log in. By default, it's the email, but we can change this to another field from our users table which is username. But for forgetting your password, I still want to use the email. Okay, so we have changed this here. But of course, nothing has changed here yet. This is what we have to do now manually. So let's take a look at the resources views um pages authentication.
Yeah, that's what it looks like for the Lari data kit. And here we have login. All right. And now instead of email, we're just using here username also for this here and for this. And we're calling it just username. And the type is now text two. And the placeholder, what do we choose your username? Maybe like this. Okay, let's um go back here. So this has not changed now. It says no username. Let me think. Should this be enough? We have changed it now on the front end. We have changed on the back end in the 45 config file that we want to use the username for logging.
I think this should already do the trick. So my username was Christoff Frumple and then my super secret password and we are in perfect. So as you've seen we could also just yeah use another field in order to log in define what it should be what it's called in database change it in the few files which are already out there for you just to adapt to your needs and change it in the config file and then you are good to go. That's one thing that's really cool about our starter kits. They give you a fast start, but you're still in control.
You're not stuck with the default, and you can shape them around your app. If you'd like to see more about Lava Stutter Kits, please let me know about them. Hit like and subscribe if you like the video. See you the next time. Bye.
More from Laravel
Get daily recaps from
Laravel
AI-powered summaries delivered to your inbox. Save hours every week while staying fully informed.









