Skip to content

Instantly share code, notes, and snippets.

Created Jun 5, 2020
What would you like to do?
How to setup Specific Subdomain routing in Laravel |
# Add the domain name of your choice laravel.test admin.laravel.test api.laravel.test
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