Skip to content

Instantly share code, notes, and snippets.

@lukzgois
Last active March 16, 2016 01:07
Show Gist options
  • Save lukzgois/67ba72dd35a5fffb385d to your computer and use it in GitHub Desktop.
Save lukzgois/67ba72dd35a5fffb385d to your computer and use it in GitHub Desktop.
Laravel CSRF Token Ajax
$.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