You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a route is registered and provides a closure rather than a Controller, calling getController() on the \Illuminate\Routing\Route instance will result in an error.
This is because getControllerClass() returns null, which is then passed into $this->container->make() on the next lines.
The expected behavior here seems like it should return null instead of attempting the make() and throwing an error. That would prevent issues with calling this method and return an expected result of null for the return.
I can submit a PR if y'all consider this a viable fix.
Steps To Reproduce
Register a route with a closure instead of a Controller.
Call getController() on a \Illuminate\Routing\Route instance for that route.
The text was updated successfully, but these errors were encountered:
Laravel Version
10.34.2
PHP Version
8.2.8
Database Driver & Version
Postgres
Description
If a route is registered and provides a closure rather than a Controller, calling
getController()
on the\Illuminate\Routing\Route
instance will result in an error.This is because
getControllerClass()
returnsnull
, which is then passed into$this->container->make()
on the next lines.The expected behavior here seems like it should return
null
instead of attempting themake()
and throwing an error. That would prevent issues with calling this method and return an expected result ofnull
for the return.I can submit a PR if y'all consider this a viable fix.
Steps To Reproduce
getController()
on a\Illuminate\Routing\Route
instance for that route.The text was updated successfully, but these errors were encountered: