Skip to content

Instantly share code, notes, and snippets.

@tnorthcutt
Last active December 6, 2018 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tnorthcutt/84a5a4b26d69aea91c25310c65568d56 to your computer and use it in GitHub Desktop.
Save tnorthcutt/84a5a4b26d69aea91c25310c65568d56 to your computer and use it in GitHub Desktop.
/**
* We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the
* CSRF token as a header based on the value of the "XSRF" token cookie.
*/
window.axios.defaults.headers.common = {
'X-Requested-With': 'XMLHttpRequest',
'X-CSRF-TOKEN': Spark.csrfToken
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment