How to add the CSRF field to a form generated with jquery.(Laravel 5)
问题 Laravel requires you to write your form like this. <form method ="POST" action="whatever"> {{ csrf_field() }} </form> I've already created around 15 forms with jquery in my website with code like the following. $("#formholder).append("<form id='myForm' method='post' action ='whatever'></form>"); My Question is: How do I add the csrf field on these forms created with jquery? 回答1: Put this meta tag into the main Blade template with other meta tags: <meta name="csrf-token" content="{{ csrf_token