Why is my CSRF token empty when using Form::open()?

后端 未结 5 1256
滥情空心
滥情空心 2021-02-15 17:38

I am just starting out so please forgive me. I have a solid grasp on CodeIgniter, so I understand what is going on. However, I am noticing that my CSRF token is empty w

5条回答
  •  被撕碎了的回忆
    2021-02-15 18:06

    This is a config issue .You need to set the app key in your config file ...config/app.php to a 32 character string or use artisan cli php artisan key:generate to genearte the key for you to be able to use the CSRF token .

    Also make sure that you include routes that use the CSRF token in the web group route .

    You may exclude URIs by defining their routes outside of the web middleware group that is included in the default routes.php file, or by adding the URIs to the $except property of the VerifyCsrfToken middleware: http://laravel.com/docs/5.2/routing#csrf-protection

提交回复
热议问题