Get fullUrl in laravel 5.1

后端 未结 3 1393
迷失自我
迷失自我 2020-12-28 14:10

i have multiple bootstrap tabs where each one do different action from others tabs for exmaple

app-url/users#creat-admin-users-tab app-url/users#

3条回答
  •  天涯浪人
    2020-12-28 14:53

    Laravel has functionality to return you the current url. It is all specified in this page: http://laravel.com/api/5.0/Illuminate/Http/Request.html

    What you are looking for is Request::fullUrl().

    Let's say I'm on http://laravel.dev/test?test=1, here are the methods and the results:

    Request::fullUrl()
    // Returns: http://laravel.dev/test?test=1
    Request::url()
    // Returns: http://laravel.dev/test
    Request::path()
    // Returns: test
    Request::root()
    // Returns: http://laravel.dev 
    

提交回复
热议问题