You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's currently no way to prevent the default routes from being registered. This isn't great when you want to have more control over the paths of each route. It would be great to be able to call Jetstream::ignoreRoutes() and to provide the option of exporting the default routes.
Current Workaround
Here's what I'm currently doing to overcome this. Warning, this code is extremely cursed and should probably not be used in production 😅
I was wondering the same but to be honest I don't think this is the right way.
You could disable the auto-discovery for this package and do it manually. Add this to your composer.json
now you need to register your custom routes/views so in App\Providers\JetstreamServiceProvider extend the base Provider and override whatever you need. e.g
class JetstreamServiceProvider extends \Laravel\Jetstream\JetstreamServiceProvider
{
public function boot()
{
// See required parent methods
// e.g $this->configureComponents()
// Register the custom routes or move it the RouteServiceProvider or whatever seems logic
Route::group([
'namespace' => 'Laravel\Jetstream\Http\Controllers',
'domain' => config('jetstream.domain', null),
], function () {
$this->loadRoutesFrom(base_path('routes/jetstream.php'));
});
// $this->configurePermissions();
}
//
}
I am also intrested in knowing if this is how you're supposed to do it.
There's currently no way to prevent the default routes from being registered. This isn't great when you want to have more control over the paths of each route. It would be great to be able to call
Jetstream::ignoreRoutes()
and to provide the option of exporting the default routes.Current Workaround
Here's what I'm currently doing to overcome this. Warning, this code is extremely cursed and should probably not be used in production 😅
Better ideas are welcome
The text was updated successfully, but these errors were encountered: