Laravel 5 CSRF global token hidden field for all forms in a page

前端 未结 6 1962
迷失自我
迷失自我 2020-12-01 23:24

I recently migrated to Laravel 5, and now CSRF check is on every post submission. I thought about removing it but I want to follow the best practices, so I\'ll keep it that

6条回答
  •  一生所求
    2020-12-02 00:10

    There is a helper to add the form token inside forms. You can just use

    {!! csrf_field() !!}
    

    inside the forms. It will add the hidden input and the token.

提交回复
热议问题