What if we switch from @{username} to just {username}?
No code changes required.
Route Group: Prefix
app/Http/routes.php
Route::group([
'prefix' => 'dashboard'
], function() {
// dashboard routes go here
});
Route Group: Domain
app/Http/routes.php
Route::group([
'domain' => '{username}.mysite.com'
], function() {
// user site specific routes go here
});
Route Group: Namespacing
app/Http/routes.php
Route::group([
'namespace' => 'Dashboard',
'prefix' => 'dashboard'
], function() {
// this route is myapp.com/dashboard
// this will use app/Http/Controllers/Dashboard/DashboardController.php
Route::get('/', 'DashboardController@getHome');
});