baneetsharma's avatar

Laravel 5.1 subdomian internal routes not working

I have inherited a laravel 5.1 project without any documnetation. Now in code base routes.php file have domain based route groups. like admin.drag.abc.xyz, mobile.drag.abc.xyz

Now : when I am hitting from admin.drag.abc.xyz/admintest my control is reaching inside the group but not inside admintest route.

Route::group(['domain' => 'admin.drag.abc.xyz'], function() {

Log::info('inside admin dns top test');

Route::get('/admintest', function() {
	Log::info('inside admin dns top test before die');
    return "Test Route Works!";
});

});

For records I am using laravel forge server and my nginx looks like below:

server_name drag.abc.xyz mobiledrag.abc.xyz admin.drag.abc.xyz; server_tokens off; root /home/drag/drag.abc.xyz/public;

location / { try_files $uri $uri/ /index.php?$query_string; }

Can someone help me in pointing out what I might be doing wrong ?

0 likes
2 replies
Talinon's avatar

@baneetsharma Make sure you don't have your routes cached, which could explain why you're not hitting your route.

php artisan route:clear

baneetsharma's avatar

@Talinon Thank you for your response. I’ve figured out the issue — I missed a middleware that was checking for domain name values in the database, and those values were missing, which caused the problem.

Please or to participate in this conversation.