Last active
March 16, 2016 01:07
-
-
Save lukzgois/67ba72dd35a5fffb385d to your computer and use it in GitHub Desktop.
Laravel CSRF Token Ajax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajaxSetup( | |
{ | |
headers: { | |
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
} | |
}); | |
//meta tag | |
document.querySelector('meta[name="csrf-token"]').getAttribute('content'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment