Skip to content

fix(workbench): use PreventRequestForgery where Laravel provides it - #88

Merged
awcodes merged 1 commit into
4.xfrom
fix/workbench-csrf-middleware
Nov 16, 2026
Merged

awcodes merged 1 commit into
4.xfrom
fix/workbench-csrf-middleware

Conversation

@awcodes

@awcodes awcodes commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Laravel 13 deprecates VerifyCsrfToken in favour of PreventRequestForgery, and a later release will remove it. This package refers to it in:

  • workbench/app/Providers/Filament/AdminPanelProvider.php

Nothing 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).

PreventRequestForgery doesn'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: PreventRequestForgery when it exists, VerifyCsrfToken otherwise. That's the same check Filament's PanelProviderClassGenerator::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

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>
@awcodes
awcodes merged commit e77a3eb into 4.x Nov 16, 2026
11 checks passed
@awcodes
awcodes deleted the fix/workbench-csrf-middleware branch November 16, 2026 18:00
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.

1 participant