laravel csrf token ajax post

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

Also in JavaScript: