In this episode, we dive into how to fully customize the routes that Laravel Jetstream uses in your application. If you've ever wanted to change route names, controllers, or the middleware attached to Jetstream routes, this is for you!
We start by looking at where Jetstream actually registers its routes—they're not in your typical routes/web.php
file, but tucked away in the composer files provided by Jetstream (whether you're using Inertia or Livewire). To customize anything, the trick is to copy the routes you want to tweak from Jetstream's default, and paste them into your own routes/Jetstream.php
file.
Once you've got your own copy, you can change the names of the routes (for example: change user.profile
to just profile
) or point them to completely custom controllers. Super flexible!
But (and this is key!), you'll end up with duplicate routes unless you explicitly tell Jetstream not to register its defaults. So, we show you how to call Jetstream::ignoreRoutes()
in your service provider, which disables the originals and leaves only your custom versions active.
By the end of this episode, you'll have the freedom to change (almost) anything about your Jetstream routes—route names, controllers, middleware, you name it. It's simple but really powerful, especially if you want to make Jetstream fit your app perfectly.