Skip to content

Instantly share code, notes, and snippets.

@jufianto
Created September 14, 2020 07:37
Show Gist options
  • Save jufianto/5caf3f1fa8a75786cc2ac6d52cf7c49e to your computer and use it in GitHub Desktop.
Save jufianto/5caf3f1fa8a75786cc2ac6d52cf7c49e to your computer and use it in GitHub Desktop.
Setup CRSF Token in JS Process
## 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