Laravel Request getting current path with query string

前端 未结 9 503
萌比男神i
萌比男神i 2020-12-23 13:20

Is there a Laravel way to get the current path of a Request with its query parameters?

For instance, for the URL:

http://www.example.com/one/two?key=         


        
相关标签:
9条回答
  • 2020-12-23 13:58

    Just putting it out there..... docs: https://laravel.com/docs/7.x/requests

    0 讨论(0)
  • 2020-12-23 13:59

    Get the current URL including the query string.

    echo url()->full();
    
    0 讨论(0)
  • 2020-12-23 14:03

    $request->fullUrl() will also work if you are injecting Illumitate\Http\Request.

    0 讨论(0)
提交回复
热议问题