laravel TokenMismatchException in ajax request

后端 未结 5 847
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 09:25

i\'m using resource group and use this filter to resolve TokenMismatchException problem:

Route::filter(\'csrf\', function($route, $request) {
           


        
5条回答
  •  孤城傲影
    2020-11-29 09:58

    You can as well add the url thats giving you the error inside the VerifyCsrfToken.php file in the

    protected $except = [
        //
    ]
    

    Let's say your route is post. You can just add in like this

    protected $except = ['post',
        //
    ];`... 
    

    Hope this helps others.

提交回复
热议问题