EVERYONE!!! I DONT KNOW WHAT HAPPENED BUT I GOT THIS A FEW SECONDS AGO. http://snag.gy/cWENS.jpg
Trying to make an ajax request, using laravel 5
Hello all, I have been trying to figure out this thing for a while. I am just learn how to use this ajax with jquery. But for some reason, every step I make forward, I end up taking two steps back. First I was getting a csrf error, fixed that by making a meta tag with the csrf token and then pulling it into the ajax request. Here is my request now: http://snag.gy/HIcGl.jpg
Now I am getting a different error, something about decryption. Am thinking that laravel, for some reason can't decrypt the token now. looking at the decryptor class it indicates that the token that I am sending is not valid Json data. So confused now. Now it doesn't like the token I sent it... any way here is my error http://snag.gy/lyGcg.jpg
Also I am using phpStorm with laravel 5
Why don't you send the _token along with other form variables? For example:
$.ajax({
url: 'somewhere',
data: {message: 'Hello!', _token: $('input[name=_token]').val()}
});
Let me know if this fixed your issue.
Please or to participate in this conversation.