jQuery add CSRF token to all $.post() requests’ data
From Laravel documentation: You could, for example, store the token in a “meta” tag: Once you have created the meta tag, you can instruct a library like jQuery to add the token to all request headers. This provides simple, convenient CSRF protection for your AJAX based applications: $.ajaxSetup({ headers: { ‘X-CSRF-TOKEN’: $(‘meta[name=”csrf-token”]’).attr(‘content’) } }); So … Read more