-
-
Save skadimoolam/a97ed547c772541ce1030499f7d0d611 to your computer and use it in GitHub Desktop.
How to setup Specific Subdomain routing in Laravel | https://simplestweb.in/blog/how-to-setup-specific-subdomain-routing-in-laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add the domain name of your choice | |
SITE_URL=myapp.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1 laravel.test | |
127.0.0.1 admin.laravel.test | |
127.0.0.1 api.laravel.test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Route::middleware('web')->domain(env('SITE_URL'))->group(function() { | |
# .... all your marketing website routes go here | |
}); | |
Route::middleware('web')->domain('admin.' . env('SITE_URL'))->group(function() { | |
# .... all admin portal routes go here | |
}); | |
Route::middleware('api')->domain('api.' . env('SITE_URL'))->group(function() { | |
# .... all api routes go here | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment