How to get the current URL in Laravel?

By Laravel Developer

Infinitbility
1 min readDec 9, 2019

Hello guys,

If you are here for how to get the current URL in Laravel then you absolutely get answered…

Laravel provides several helpers to assist you in generating URLs for your 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 request...
echo url()->previous();

Each of these methods may also be accessed via the URL facade:

use Illuminate\Support\Facades\URL;echo URL::current();

For more visit

Thanks for reading…

--

--

Infinitbility
Infinitbility

Written by Infinitbility

Subscribe my newsletter to get weekly updates. — https://infinitbility.com/about

No responses yet