Skip to content
Advertisement

Error Ajax and Laravel 500 (Internal Sever Error)

I’m attempting to use AJAX in Chrome, but it’s not working. This is my code, which you can see below. This is a copy of my web.php file.

JavaScript

This is my ajax

JavaScript

This is the code for my controller method.

JavaScript
JavaScript

Advertisement

Answer

One change you can do is in Ajax for below line.

JavaScript

So better to pass

JavaScript

you are not using received category id from request in your query while returning view ,you are not passing categories

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement