pass csrf token in ajax laravel

79

laravel ajax csrf -

data: {
        "_token": "{{ csrf_token() }}",
        "id": id
        }

laravel csrf token ajax post -

$.ajaxSetup({
    headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    }
});

Comments

Submit
0 Comments