Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

Laravel 8 working with subdomain routing but its not working

Route::domain('{user}.xyz.com')->group(function () {
    Route::get('/posts', [PostsController::class, 'view'])->name('posts');
});

//Controller

class PostsController {
    public function view ($user){
        dd($user) //this will output the current user's subdomain name
    }
}
 
PREVIOUS NEXT
Tagged: #Laravel #working #subdomain #routing #working
ADD COMMENT
Topic
Name
7+3 =