// Full URL with query string
print $request->fullUrl(); // http://127.0.0.1:8000/sometext?city=hyd
// Get the path part of the URL
print $request->path(); // sometext
// Root (protocol and domain) part of the URL)
print $request->root(); //http://127.0.0.1:8000
//Get the full URL for the previous request
print url()->previous();
//tested on Laravel 5.6
//OR
use IlluminateSupportFacadesURL;
print URL::current();