Hello!
I'm trying to keep my routes files as clean as possible, so I'm trying to register different route files in RouteServiceProvider.php.
Basically, I'm separating them by subdomains, and then I'll slim down from there by requiring other route files.
Currently, here's what I have:
public function boot()
{
$this->configureRateLimiting();
$this->routes(function () {
Route::domain('admin.example.test')
->namespace($this->namespace)
->name('admin')
->as('admin.')
->middleware(['auth','can:access_admin', 'password.confirm'])
->group(base_path('routes/admin.php'));
Route::middleware('web')
->namespace('App\Http\Controllers')
->group(base_path('routes/web.php'));
});
Now when I run that, everything works as normal. Even when I run php artisan route:list, it shows that the routes are all there. Except when I go to the index page for the admin subdomain (admin.example.test), it redirects back to the dashboard on the primary domain (example.com/dashboard).
Is it not possible to add subdomains this way or am I doing something wrong?
