I am using laravel 10 php 8.10 for work, here the javascript ajax button is working fine on php artisan serve http://127.0.0.1 but getting error on **MAMP PRO** (localhost:8888) ( An error occurred while processing the request) and does not work on the url http://localhost:8888/xxx/public. The following are snippets of html and js:
Need help solving this problem.
**HTML** @if($row->soc_extra==1) @else @endif > @endforeach **JS**
Need help solving this problem.
Is your MAMP Apache port indeed set to port 8888 and not port 80?
I've done this a few times (port 8888 for testing, port 80 for deployment) and kept the Ajax calls targeting localhost instead of localhost:8888 or vice versa.
Alternatively, you may need to explicitly specify the 8888 port in the Ajax call, for example:
url: 'http://localhost:8888/admin/update-socialmedia-status'
Hope this helps?