laravel get full url code example

Example 1: get full url php

$fullURL = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

Example 2: how get url in laravel

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

Example 3: current URL without url site laravel

is work
{{Request::path()}}
or
request()->path()

Example 4: current url route laravel

\Route::current()
############### OR ####################
$request->getRequestUri()

Example 5: laravel get last get request

{{ url()->previous() }}

Tags:

Php Example