tanthammar/livewire-auto-routes
Livewire Auto Routes automatically registers routes for your Livewire components using convention-based discovery, eliminating repetitive route definitions. Simple setup, customizable patterns, works seamlessly with Laravel and Livewire.
composer require tanthammar/livewire-auto-routes
php artisan vendor:publish --provider="Tanthammar\LivewireAutoRoutes\LivewireAutoRoutesServiceProvider" --tag=config
config/livewire-auto-routes.php. This is the first file to read — it defines the component directory/namespace that gets scanned, the URL prefix, and any middleware/route-group settings the package applies.app/Http/Livewire/UserProfile.php. With the package's default conventions you should get a working route at /user-profile without touching routes/web.php.First use case: replacing a pile of boilerplate Route::get('/foo', Foo::class) entries with a component that "just works" by living in the right directory with the right class name. Verify with php artisan route:list --path=user-profile.
app/Http/Livewire/Admin/Reports/Index.php → /admin/reports/index under the default mapping). Keep the directory clean; anything you don't want routed should live outside the scanned path./users/{user}), custom names, or domain constraints. There's no reliable way to express dynamic segments through a filename — don't fight it.Route::middleware([...])->group(...) inside your RouteServiceProvider if the package exposes a registration hook, or register the package routes inside your existing groups.boot() so php artisan route:cache captures them. Add route:clear to your deploy script if you add/remove components.app/Http/Livewire) is Livewire 2 era; Livewire 3 moved to app/Livewire and changed layout/rendering behavior. Expect to update the config namespace and test carefully, or fork the package.SSOLogin, APIv2Settings). Rename the class if the URL matters.php artisan route:list and route:list --path=... to inspect ordering, and remove components from the scanned directory if you need a manual route to win.route:cache on a build that adds components later means the new URL 404s until you recache. Put route:clear && route:cache in deploy.config('livewire-auto-routes.*')), confirm the component file is in the scanned path, confirm the namespace in the config matches the actual PHP namespace, then check route:list.RouteServiceProvider::boot() over File::allFiles(app_path('Livewire')) building route strings from relative paths. If the package is unmaintained and you only need this behavior, a small in-house helper is often the better trade.How can I help you explore Laravel packages today?