Reputation: 8385
I am new to laravel and I am wondering is there a way to do this?
How could I make my subdomain load a specific laravel route/controller?
Upvotes: 1
Views: 45
Reputation: 8521
It's all in the official docs:
The sub-domain may be specified using the
domain
key on thegroup
attribute array:
And the way to do it is as follows:
Route::group(['domain' => '{account}.myapp.com'], function () {
Route::get('user/{id}', function ($account, $id) {
//
});
});
Upvotes: 1