Route::get('/', function () {
return view('home.welcome');
});
Route::group(['domain' => 'dashboard.homestead.app'], function () {
Route::get('/', function () { return 'hello,world!';});
});
已經在homestead和hosts裡配置了dashboard.homestead.app。但是當訪問dashboard.homestead.app顯示的仍然是上面路由的的內容(home.welcome).
但是如果寫成這樣
Route::group(['domain' => 'dashboard.homestead.app'], function () {
Route::get('/test', function () { return 'hello,world!';});
});
訪問dashboard.homestead.app/test是正常顯示的hello world.
這是為什嗎?不能直接存取dashboard.homestead.app得到hello world嗎?
回複內容:
Route::get('/', function () {
return view('home.welcome');
});
Route::group(['domain' => 'dashboard.homestead.app'], function () {
Route::get('/', function () { return 'hello,world!';});
});
已經在homestead和hosts裡配置了dashboard.homestead.app。但是當訪問dashboard.homestead.app顯示的仍然是上面路由的的內容(home.welcome).
但是如果寫成這樣
Route::group(['domain' => 'dashboard.homestead.app'], function () {
Route::get('/test', function () { return 'hello,world!';});
});
訪問dashboard.homestead.app/test是正常顯示的hello world.
這是為什嗎?不能直接存取dashboard.homestead.app得到hello world嗎?