-
Hello there! I'm currently trying to achieve the following: somewhere in my code, I want to dynamically resolve all of the currently registered routes that are tied to a given controller, so I can list them on a page. In order to do this, I made the following function: use App\Http\Controllers\MyController;
use Illuminate\Routing\Route;
use Illuminate\Support\Facades\Route as RouteFacade;
protected function getRoutes()
{
return collect(RouteFacade::getRoutes())
->filter(fn(Route $route) => $route->getControllerClass() === MyController::class);
} The issue with this approach is that
Does anyone have any suggestions on this? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Resolved by #46411 |
Beta Was this translation helpful? Give feedback.
Resolved by #46411