Posts Learn Components Snippets Categories Tags Tools About

Laravel Get URL Path

Learn how to get the current url, previous url and next url in Laravel application

Created on Sep 08, 2021


Sometimes you might need to get the URL of a current route and below are several ways to get it.

Laravel Get Current URL, Laravel Full URL, Laravel Previous URL

Do note that you can call make use of the "url()" helper from anywhere within the application.

// Get the current URL without the query string
echo url()->current();

// Get the current URL including the query string
echo url()->full();

// Get the full URL for the previous requess
echo url()->previous();

If you like our tutorial, do make sure to support us by being our Patreon or buy us some coffee ☕️

Load comments for Laravel Get URL Path