It’s always fun trying to do things the right way. I’m implementing some filters that keep a person from bypassing a specific page until they handle all the items on the list. It’s a challenge. The keeping them on the page and the passing on it for now is easy. Now I have to figure out exactly how to manage the “taking care of it” part.
However I wasn’t liking the possiblity that I could introduce errors in processing by resolving the request to get the route name. So after about 2 hours of searching for alternatives I finally found a method that doesn’t require me to resolve the request but I can still get the name.
$route = Route::getRoutes()->match($request); $route_name = $route->getName();