Friday, October 24, 2025
HomeLanguagesLaravel Get Current URL With Parameters

Laravel Get Current URL With Parameters

To get the current URL with parameters, domain, etc in laravel; In this tutorial, we will learn how to get the current URL with parameters, current URL Path on controller and blade views in laravel 10|9|8 apps.

How to Get Current URL in Laravel 10|9|8

Using the following url()->full(), Request::url(), url()->current(), you can get url path in laravel 10|9|8 apps:

  • Get Global and Current URL
  • Get Current URL path
  • Get the previous URL in Laravel

Get Global and Current URL

You can get current URL, global url with the query string in laravel apps using url(), url()->current, url()->full(); as follows:

echo \Request::url();

Use global url function

echo url()->url();

Use the current function

echo url()->current();

Get current full URL with query string parameters

echo url()->full();

Get Current URL path

Using the laravel path() method, you can get the current path of url in laravel:

 $request->path() 

Get the previous URL in Laravel

Sometimes you need to check what was the last requested or previous URL, it is simple to do in laravel here is how

echo url()->previous();

If you have any questions or thoughts to share, use the comment form below to reach us.

Recommended Laravel Tutorials

Recommended:-Laravel Try Catch

RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS