Skip to content

Conversation

@SanderMuller
Copy link
Contributor

@SanderMuller SanderMuller commented Jan 14, 2025

This PR reimplements #54134, which was reverted in #54185 due to a breaking change. A regression test has since been added, ensuring the change can be safely reintroduced.

Key Changes:

  • Replaces string-based references to framework controllers with ::class constants for better type safety and maintainability.
  • Adds isFrameworkController() and getFrameworkControllers() methods to centralize framework controller handling.
  • Updates prependGroupNamespace() to respect framework controllers and avoid unnecessary namespace prefixing.

This reimplementation leverages the regression test to address previous concerns while improving code consistency and developer experience.

* @param \Illuminate\Routing\Route $route
* @return bool
*/
protected function isFrameworkController(Route $route)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably drop this method and just use $this->router->isFrameworkController((string) $route->getControllerClass()) directly, but I didn't want to introduce this potential breaking change since it's a protected method in a non final class

@taylorotwell
Copy link
Member

I'm not sure what we're actually solving for here. I think it's fine. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants