来自文档:
// Get the current URL without the query string...
echo url()->current();
// Get the current URL including the query string...
echo url()->full();
Run Code Online (Sandbox Code Playgroud)
这些方法中的每一个都可以通过 URL 外观来访问:
use Illuminate\Support\Facades\URL;
echo URL::current();
Run Code Online (Sandbox Code Playgroud)
如果您使用命名路由(不是强制性的):
echo route('post.show', ['post' => 1]);
// http://example.com/post/1
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
7953 次 |
最近记录: |