Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[13.x] Add route removal functionality to RouteCollection#56055

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
TobMoeller wants to merge1 commit intolaravel:master
base:master
Choose a base branch
Loading
fromTobMoeller:remove_routes

Conversation

TobMoeller
Copy link
Contributor

This PR adds aremove() method to theRouteCollection andCompiledRouteCollection classes, enabling the removal of previously defined routes. This is particularly useful for overriding or removing routes defined by third-party packages.

Context

I had several cases where package-defined routes interfered with my application's use case or needed modification (changing middleware, etc.) without removing the package itself. This change enables such removal/overriding of routes defined by third-party packages.

Note

This is a breaking change as it adds a new method to theRouteCollectionInterface. I'm targeting the master branch but am open to targeting the 12.x branch if preferred.

Further Discussion

Is there interest in extending this functionality to make it easier to modify existing routes (e.g., changing middleware)? One idea would be to add functionality to define a new route and remove the existing one in a single operation.

@taylorotwelltaylorotwell marked this pull request as draftJune 17, 2025 16:51
@TobMoeller
Copy link
ContributorAuthor

Hi! I noticed the PR was marked as draft. Just wanted to check if there’s anything specific I should address or improve, or if I should wait until the master branch’s tests are green before continuing.

I’ve looked into the test failures and they seem unrelated to my changes, but I’m happy to dig deeper if needed.

@crynobonecrynobone changed the title[master] Add route removal functionality to RouteCollection[13.x] Add route removal functionality to RouteCollectionJul 7, 2025
@osbre
Copy link
Contributor

without removing the package itself.

The alternative way is to fork the package and remove the unnecessary routes.

@TobMoeller
Copy link
ContributorAuthor

without removing the package itself.

The alternative way is to fork the package and remove the unnecessary routes.

Thank you for your input—forking the package is definitely an option and, in some situations, it may be the only way to customize things deeply.

However, I’d argue that forking introduces quite a bit of extra complexity and maintenance overhead, especially for minor changes like tweaking or removing a route.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@TobMoeller@osbre

[8]ページ先頭

©2009-2025 Movatter.jp