DekGenius.com
PHP
laravel get current route name
Route::currentRouteName()
laravel get current route name
request()->route()->getName()
get current route laravel
get URL:
{{ Request::url() }} // http://localhost/path
get path:
{{ Request::path() }} // path
laravel route is current route
Route::currentRouteName()
Route::getCurrentRoute()->getPath();
Request::route()->getName()
Route::currentRouteName(); //use IlluminateSupportFacadesRoute;
Route::getCurrentRoute()->getActionName();
$uri = $request->path();
get current route in blade laravel
Get the current url
here using the Request::url() method. It will return the entire URL, but strip the query string from it.
<p> Url: {{ Request::url() }} </p>
Output
Url: http://localhost:8000/post/demo
get current route in blade laravel
<p> Path: {{ Request::path() }} </p>
laravel get current route name
Route::getCurrentRoute()->getActionName();
laravel route Accessing The Current Route
$route = Route::current();
$name = Route::currentRouteName();
$action = Route::currentRouteAction();
laravel is route name
// Check if route is ***
Request::route()->named("YourRouteNameView")
laravel get current route url
@if(Request::url() === 'your url here')
// code
@endif
laravel route is current route
Route::currentRouteName() == 'my_route_name'
laravel get route
Route::get('foo', function () {
return 'Hello World';
});
laravel get route
Route::get('/user', 'UserController@index');
laravel get current route url
if (Request::is('admin/*'))
{
// code
}
get current route in blade laravel
© 2022 Copyright:
DekGenius.com