Today, i am going to show you how to get current url, base url with parameter in your controller or view file. We may sometime need to get current url in controller method or maybe in blade file. So it's not difficult to do this thing in laravel 5.5 application.
Laravel provide Request and URL facade for getting request data. So we can simply get those current url using Request and URL facade. we can also get full url means you can get query string of url too. So i give you one by one both example As listed bellow:
$currentURL = \Request::fullUrl();
Get Current URL without Parameters:
$currentURL = \URL::current();
$currentURL = \Request::url();
Get Only Parameters:
$parameters = \Request::segment(3);
I hope you found your solutions....