Get current route in Laravel

There are methods to get the current route in Laravel but you need to know which is the method to be used in that version. We are listing the methods along with the Laravel version.

Laravel 5

Route::getCurrentRoute()->getPath();

Laravel 5 and above

use Illuminate\Support\Facades\Route;

$currentPath= Route::getFacadeRoot()->current()->uri();

Laravel 5.3

Route::currentRouteName(); //use Illuminate\Support\Facades\Route;