Laravel Request getting current path with query string

前端 未结 9 501
萌比男神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:54

    Similar to Yada's answer: $request->url() will also work if you are injecting Illuminate\Http\Request

    Edit: The difference between fullUrl and url is the fullUrl includes your query parameters

提交回复
热议问题