Support the ongoing development of Laravel.io →
Security Requests

Laravel automatically adds CSRF protection for all POST requests, but what's the best way to add CSRF protection for certain GET request?

For example, by clicking the following link, blog authors could delete their own posts. However, how can we add a CSRF protection over those GET requests? http://my.laravel.app/blog/1/delete

Last updated 3 years ago.
0

Did you tried this?

Route::group(['before' => 'csrf'], function()
{
Route::resource(...);
});
Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.