我有一个laravel应用程序,我用下面的方法扩展了它:
Route::domain('{account}'.'.app.test')->group(function () {
return '{account}'."-test";
});我使用的是laragon (wamp堆栈),所以localhost/myapp地图tp app.test
但是如何在浏览器中本地调用随机子域呢?
例如,如果我尝试呼叫subdomain.app.test,我会收到来自telekom (德国现场直播)的page not found消息。
如何配置才能使其在本地工作?
发布于 2018-11-01 18:41:33
域语法应为:
Route::domain('{account}.example.com')->group(function() {
Route::get('user/{id}', function($account, $id) {
//code
});
});请参阅文档https://laravel.com/docs/5.7/routing#route-group-sub-domain-routing
https://stackoverflow.com/questions/52812463
复制相似问题