How to create subdomain in Laravel dynamically?
I have solved it. I used Acyrlic DNS Proxy from this answer. Checkout the below link you will find the answer.
then the
Route::group(['domain' => '{account}.dns.dev'], function () { Route::get('/', function ($account) { return $account; });});
is now working.
I am using laravel version above 5
$appRoutes = function() { Route::get('/',function(){ return view('welcome'); }); };Route::group(['subdomain' => '{subdomain}.yoursitename.com'], $appRoutes );
Place this code in your route file.
But in my case, the laravel app was placed after the root so is used subdomain Route like this
$appRoutes = function() { Route::get('/foldername/',function(){ return view('welcome'); }); }; Route::group(['subdomain' => '{subdomain}.yoursitename.com/foldername'], $appRoutes );