Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Sameera's avatar

AJAX get request not working,

I have two AJAX requests, one is working but the second one is not working. I add codes to github and this is the link, https://github.com/sameerakularathna/AJAX-error/tree/main

if you can help me to solve this error

0 likes
4 replies
Tray2's avatar

Without the error message it's impossible to say what is wrong.

Sameera's avatar

@Tray2 thanks for your concentration, I add SS to GitHub, and you can see that

Tray2's avatar
Tray2
Best Answer
Level 73

@Sameera like @volkanador pointed out, your route is wrong

This

Route::get('/getInfo}', [App\Http\Controllers\PaymentsController::class, 'getInfo'])->name('getInfo');

Should be this

Route::get('/getInfo', [App\Http\Controllers\PaymentsController::class, 'getInfo'])->name('getInfo');

And I also recommend importing the namespaces, it makes your code so much more readable.

use App\Http\Controllers\PaymentsController;

Route::get('/getInfo', [PaymentsController::class, 'getInfo'])->name('getInfo');
1 like
volkanador's avatar
Route::get('/getInfo}', [App\Http\Controllers\PaymentsController::class, 'getInfo'])->name('getInfo');

there is a curly bracket ('/getInfo}' < here.

1 like

Please or to participate in this conversation.