--- tags: laravel --- # 常用工具函式  ## 網址相關 ==使用URL Facade需要先use URL;== 返回當前頁面的地址 https://goblinlab.org/laravel ``` URL::full(); url()->full(); ``` 返回當前頁面的完整網址 https://goblinlab.org/laravel ``` URL::current(); url()->current(); Request::url(); $request->url(); Input::url(); ``` 返回前一個頁面的地址 https://goblinlab.org ``` URL::previous(); url()->previous(); ``` 返回路徑 /laravel ``` Request::path(); $request->path(); ``` 返回請求Uri /laravel?key=value ``` Request::getRequestUri(); $request->getRequestUri(); ``` 返回Uri https://goblinlab.org/laravel?key=value ``` Request::getUri(); $request->getUri(); ``` 返回基礎路由訊息 `$request->route()->getAction();`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up