close

[Solved] Laravel 5.5 ajax call 419 (unknown status)

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Laravel 5.5 ajax call 419 (unknown status) in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Laravel 5.5 ajax call 419 (unknown status) Error Occurs?

Today I get the following error Laravel 5.5 ajax call 419 (unknown status) in php.

How To Solve Laravel 5.5 ajax call 419 (unknown status) Error ?

  1. How To Solve Laravel 5.5 ajax call 419 (unknown status) Error ?

    To Solve Laravel 5.5 ajax call 419 (unknown status) Error just serialize the form data and get your problem solved.
    data: $('#form_id').serialize(),

  2. To Solve Laravel 5.5 ajax call 419 (unknown status) Error

    To Solve Laravel 5.5 ajax call 419 (unknown status) Error just serialize the form data and get your problem solved.
    data: $('#form_id').serialize(),

Solution 1

Another way to resolve this is to use the _token field in ajax data and set the value of {{csrf_token()}} in blade. Here is a working code that I just tried at my end.

$.ajax({
    type: "POST",
    url: '/your_url',
    data: { somefield: "Some field value", _token: '{{csrf_token()}}' },
    success: function (data) {
       console.log(data);
    },
    error: function (data, textStatus, errorThrown) {
        console.log(data);

    },
});

Solution 2

just serialize the form data and get your problem solved.

data: $('#form_id').serialize(),

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment