How to disable CSRF Token in Laravel and why we have to disable it?

前端 未结 7 1338
攒了一身酷
攒了一身酷 2020-11-30 06:39

I want to see how I can disable CSRF token in Laravel and where I have to disable it. Is this good to disable it or not?

7条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 07:16

    You can Disable CSRF on few routes by editing.

    App\Http\Middleware\VerifyCsrfToken 
    

    and add your own routes name in protected

    $except = [] array.
    

    It does not seems to be good practice as by doing this we are removing security feature of Laravel.

提交回复
热议问题