How to Get Current URL in Laravel

In this post i explain how to get current URL in Laravel. In this post you get simple way to get current url path in your laravel application. Laravel has lot of methods for get current URL or Path in laravel such as current(), full(), request(), url().

Get Current URL using url and full method.

$currenturl = url()->full();

echo $currenturl;

Get Current URL using current method

$currenturl = url()->current();

echo $currenturl;

Get Current URL using current() with Facade

$currenturl = URL::current();

echo $currenturl;

Get Current URL using Request

$currenturl = Request::url();

echo $currenturl;

I hope it can help you…

Read Also :  Laravel 8 Clear Cache of Route, View & Config