sajjadali's avatar

500 (Internal Server Error) on Laravel ajax request localhost

I am facing 500 (internal server error) on laravel ajax request when sending ajax request to get pagination data on localhost. I have added in head section

and in ajax script

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

also tested with token

data: { "_token": $('meta[name="csrf-token"]').attr('content'), },

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

URL http://127.0.0.1:8000/posts?page=1&_token=lu7RlnbcCZ67Luc3cfMNFtoi4OyMduKQVXS6zRxe

what could be the reason ?

0 likes
1 reply
Sergiu17's avatar
Sergiu17
Best Answer
Level 60

500 means that there's a problem on the server side ( php ), open you logs ( storage directory ) and see what is there

Please or to participate in this conversation.