Laravel 6 Get Current URL Tutorial

Laravel 6 Get Current URL Tutorial

In this post, you'll learn how you can get the current URL in Laravel 6. Also, this tutorial shows you how you can get the previous URL in Laravel

Originally published at https://www.tutsmake.com

How to Get Current Request URL

Us the below give a method for get current URL without the query string

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();

How to get Current URL path

Use the below method for- get the current path in Laravel

 $request->path() 

Get the previous URL in Laravel

Sometimes we 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.   

Thanks for reading

If you liked this post, share it with all of your programming buddies!

Follow me on Facebook | Twitter

Further reading

☞ Tutorial Laravel 6 with Docker and Docker-Compose

☞ Laravel 6 Release New Features and Upgrade

☞ What's New in Laravel 6.0?

☞ Laravel 6 CRUD Application Tutorial

laravel php web-development

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

PHP Web Application Development Company

As a top **PHP Web Application Development Company in USA**[https://www.dataeximit.com/php-development-services/](https://www.dataeximit.com/php-development-services/ "https://www.dataeximit.com/php-development-services/"), we at Data EximIT have...

PHP Website Development

Skenix Infotech is a leading PHP Web Development Company that helps companies get results with industry best practices. Get affordable PHP Development Services.

Laravel Development Company

Skenix Infotech is a top Laravel Website Development Company with Expert Laravel Developers that provides robust Laravel Development Services at fair costs.

Hire Dedicated PHP Developer

Looking to hire affordable yet experienced PHP developers? **[Hire Dedicated PHP Developer](https://hourlydeveloper.io/hire-dedicated-php-developer/ "Hire Dedicated PHP Developer")**, who can convert your idea to reality, within the stipulated...

Hire PHP Developer

Looking to develop a PHP based website from scratch or revamp your existing website? **[HourlyDeveloper.io](https://hourlydeveloper.io/ "HourlyDeveloper.io")** has always been an industry leader for companies and business owners looking to hire...