【发布时间】:2016-04-02 17:59:27
【问题描述】:
考虑以下示例:
Route::group(['domain' => 'something.example.local'], function() {
Route::get('scripts', 'SomethingController@scripts');
});
现在假设您在something.example.local/scripts 上,并且您将鼠标悬停在这样的链接上:<a href="{{ url(/scripts) }}">hello world</a> 您将看到something.example.local/scripts。很棒。
不去example.local 并做同样的事情:example.local/scripts .... 错了。它应该说:something.example.local/scripts。
如何使用 laravel 辅助方法来获取合适且完整的 url、域等?
【问题讨论】:
标签: php laravel routing subdomain laravel-5.2