How can I get new CSRF token in LARAVEL by using ajax
PHP Snippet 1:
<script type="text/javascript">
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
}
});
</script>
PHP Snippet 2:
<meta name="_token" content="{!! csrf_token() !!}" />