try with this
Route::getCurrentRoute()->getPath();
or
\Request::route()->getName()
from v5.+
use Illuminate\Support\Facades\Route;
$currentPath= Route::getFacadeRoot()->current()->uri();
Laravel 5.3
Route::currentRouteName();
or if u need action name
Route::getCurrentRoute()->getActionName();
You can find everything about laravel Routes in Laravel API:http://laravel.com/api/5.0/Illuminate/Routing/Router.htmlhttp://laravel.com/api/5.0/Illuminate/Routing.html
Retrieving The Request URI
The path method returns the request's URI. So, if the incoming request is targeted at http://domain.com/foo/bar
, the path method will return foo/bar
:
$uri = $request->path();
The is
method allows you to verify that the incoming request URI matches a given pattern. You may use the *
character as a wildcard when utilizing this method:
if ($request->is('admin/*')) {
//
}
To get the full URL, not just the path info, you may use the url method on the request instance:
$url = $request->url();