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吗?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
顺序问题,特殊的路由放前面
我也遇到这种问题了,请问你的解决了吗,可否分享一下解决方法,谢谢!