Home / Snippets / Laravel Get URL Path
Laravel Get URL Path cover

Laravel Get URL Path

370

3 years ago

0 comments

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.
<?php

// 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();
notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

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

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this