How to get current url with parameters in Laravel?

Posted by LaravelIndia - 1 year ago

Example 1: Using URL Facade

public function index()
{
    $getFullURL = \URL::full();
    dump($getFullURL);
}

Example 2: Using Request Facade

public function index()
{
    $getFullURL = \Request::fullUrl();
    dump($getFullURL);
}

Example 3: Using $request Object

public function index(Request $request)
{
    $getFullURL = $request->fullUrl();
    dump($getFullURL);
}