After hours of research for the right keyword to implement a simple way of using wild card dns on laravel.
Here I'm using windows 10 and laragon.
This is the code I tried to implement in laravel route
Route::group(['domain' => '{account}.tindahan.local'], function() {
Route::get('/page-one', function () {
return view('welcome0');
});
Route::get('/page-two', function () {
return view('welcome1');
});
});
Base on the articles I read which you need to setup something like *.domian.com
on vhost I have this automatically set in laragon
<VirtualHost *:80>
DocumentRoot "C:/laragon/www/tindahan/public/"
ServerName tindahan.local
ServerAlias *.tindahan.local
<Directory "C:/laragon/www/tindahan/public/">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
But when I tried to visit page-one.tindahan.local
on Chrome browser I got this message
This site can’t be reached
I don't know what's missing of what I am doing. This is the first time I am doing something like this, so basically I don't have lots of idea.
Can you give me the right way to implement this?