Today now in this post i will show you how to get current route name in laravel application. Whenever we need to get the current route name then we can get by using Request or Route facade.Here I will give you two example way one for by using Route facade and another one for by using Request facade.
so we can get the route name both way and how we can see both example.
$routeName = Request::route()->getName()); print($routeName);
$routeName = Route::getCurrentRoute()->getPath(); print($routeName);
Read Also : How to convert Object into Array in PHP?
Thanks for read. I hope it help you. For more you can follow us on facebook.