laravel ajax post data to controller

Solutions on MaxInterview for laravel ajax post data to controller by the best coders in the world

showing results for - "laravel ajax post data to controller"
Myra
21 Sep 2018
1 $.ajax({
2            url: "/route/to",
3            type: 'POST',
4            beforeSend: function (request) {
5                return request.setRequestHeader('X-CSRF-Token', $("meta[name='csrf-token']").attr('content'));
6            },
7            success: data => {
8                console.log(data);
9            }
10        });