Repository navigation
fix(workbench): use PreventRequestForgery where Laravel provides it - #88
Merged
Merged
Conversation
Laravel 13 deprecates VerifyCsrfToken in favour of PreventRequestForgery. Laravel 12, still in the CI matrix, has no PreventRequestForgery, so pick the class at runtime the way Filament's PanelProviderClassGenerator does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Laravel 13 deprecates
VerifyCsrfTokenin favour ofPreventRequestForgery, and a later release will remove it. This package refers to it in:workbench/app/Providers/Filament/AdminPanelProvider.phpNothing fails today, because this package doesn't run
phpstan/phpstan-deprecation-rules. mason and richer-editor do, and their Static Analysis already failed on the same reference (awcodes/mason#97, awcodes/richer-editor#39).PreventRequestForgerydoesn't exist in Laravel 12, which is still in the CI matrix, so a plain rename would break those rows. Each panel now picks the class at runtime:PreventRequestForgerywhen it exists,VerifyCsrfTokenotherwise. That's the same check Filament'sPanelProviderClassGenerator::getCsrfMiddlewareClass()uses. The fallback can go once Laravel 12 leaves the matrix.Checked locally on Laravel 13: PHPStan, Rector, Pint and the Pest suite all pass. CI covers the Laravel 12 rows.
🤖 Generated with Claude Code