I know that in previous versions of Laravel you could fetch the name by calling the getCurrentRoute in the route class, but since 5.5 was released it still remains a mystery on how I can do this?
In previous versions, this is how I did it.
Route::getCurrentRoute()->getPath();
You can call the currentRouteName
on the route class.
Route::currentRouteName();
Don't forget to use the class.
use Illuminate\Support\Facades\Route;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With