Commit 8de101e
committed
minor #19867 The #[IsCsrfTokenValid] attribute eliminates the need for a request parameter in your method. (rcsofttech85)
This PR was merged into the 7.1 branch.
Discussion
----------
The #[IsCsrfTokenValid] attribute eliminates the need for a request parameter in your method.
#[IsCsrfTokenValid] attribute in Symfony 7.1 does not require you to include a request parameter in the method itself. The attribute uses the request object internally to access the submitted data for validation.
for example
```php
#[Route(path: '/admin/post/delete', name: 'admin_post_delete', methods: ['POST'])]
#[IsCsrfTokenValid('delete-item')]
public function adminPostDelete(): Response
{
dd('deleted');
}
```
Commits
-------
979891b Removed unnecessary Request parameter1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
0 commit comments