I have my routes set up as follows:
\'{username}.u.\'.env(\'APP_DOMAIN\'),
], function () {
Route::get(\'/\', \
You can't have a wildcard on the whole domain, at least not with one wildcard. What you can do is the following:
Route::group([
'domain' => '{domain}.{suffix}',
], function () {
Route::get('/', 'FrontendController@domain');
});
Just make sure that this group is the last one in your routes file, it will act as a fallback group on domains and will serve the requests that don't match any of the previous domains.
Also I'd recommend using this package, it might be helpful for what you are trying to do.