Created
September 14, 2020 07:37
-
-
Save jufianto/5caf3f1fa8a75786cc2ac6d52cf7c49e to your computer and use it in GitHub Desktop.
Setup CRSF Token in JS Process
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
## Set to app.blade.php | |
```html | |
<script> | |
$.ajaxSetup({ | |
headers: { | |
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
} | |
}); | |
</script> | |
``` | |
```html | |
<meta name="csrf-token" content="{{ csrf_token() }}"> | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment