Skip to content

chore: rename CSRF middleware to PreventRequestForgery for Laravel 13#484

Merged
peterfox merged 6 commits intodriftingly:mainfrom
MrPunyapal:feat/rename-csrf-token-middlware
Mar 24, 2026
Merged

chore: rename CSRF middleware to PreventRequestForgery for Laravel 13#484
peterfox merged 6 commits intodriftingly:mainfrom
MrPunyapal:feat/rename-csrf-token-middlware

Conversation

@MrPunyapal
Copy link
Copy Markdown
Contributor

Per the Laravel 13 upgrade guide, the CSRF middleware classes have been renamed. This PR updates the Laravel 13 set to automatically rename direct references to the new middleware class.

Using Rector's core RenameClassRector is consistent with existing class-renaming patterns across the project and handles use statements, ::class references, type hints, and class inheritance automatically.

@calebdw
Copy link
Copy Markdown
Collaborator

calebdw commented Mar 18, 2026

I doubt the tests will pass unless you create stubs, just remove the tests--- there's no need to test rector

@MrPunyapal
Copy link
Copy Markdown
Contributor Author

okay removed tests 😅

Copy link
Copy Markdown
Collaborator

@peterfox peterfox left a comment

Choose a reason for hiding this comment

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

I actually think the tests would be worth while, just because it makes it clear what the set does but I'm happy to merge as is

@MrPunyapal MrPunyapal force-pushed the feat/rename-csrf-token-middlware branch from da5387f to 7ccb6b6 Compare March 19, 2026 18:20
@MrPunyapal
Copy link
Copy Markdown
Contributor Author

@peterfox added tests back

@MrPunyapal MrPunyapal requested a review from peterfox March 21, 2026 10:27
@peterfox peterfox merged commit 27f7bf0 into driftingly:main Mar 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants