In this tutorial, today we discuss about how to get current URL with parameters in laravel 6(Laravel 6 In Get Current URL with Parameters). we can get by using the URL helper class and also use the facade class and request an object for laravel get URL. so we gave following below various types for how to get the current URL(laravel get URL).
Get the current URL without the query string
$currentURL = url()->current(); dd($currentURL);
Get the current URL including the query string
$currentURL = url()->full(); dd($currentURL);
Get the full URL for the previous request
$preURL = url()->previous(); dd($preURL);
Get the current URL Without Query String
$currentURL = $request->url(); dd($currentURL);
Get the current URL With Query String
$currentURL = $request->fullUrl(); dd($currentURL);
Get Only Parameters Using segment
//http://www.example.com/one/two?key=value $currentURL = $request->segment(3); dd($currentURL);
Please follow and like us:
Very interesting topic, thankyou for putting up.
It’s really a great and helpful piece of info. I am glad that you shared this useful information with us. Please keep us informed like this. Thanks for sharing.
Good day! This post couldn’t be written any better! Reading this post reminds me of my old room mate! He always kept chatting about this. I will forward this write-up to him. Fairly certain he will have a good read. Many thanks for sharing!
Very good info. Lucky me I found your site by accident (stumbleupon). I have saved as a favorite for later!
Thank you for sharing excellent informations. Your site is very cool. I’m impressed by the details that you?¦ve on this blog. It reveals how nicely you understand this subject. Bookmarked this website page, will come back for more articles. You, my friend, ROCK! I found simply the information I already searched everywhere and just couldn’t come across. What a perfect site.