[Vuejs]-Laravel vue SPA page returning HTML instead of json value on ajax request

2👍

There is a dolar sign in the route where there shouldn’t be one.

try changing {$email} to {email}

1👍

The header seems to be Ok, so to avoid this add a condition in your web routes :

Route::get('/{any}', function () {
  return view('welcome');
})->where('any', '^(?!api).*');

This should tell laravel to use api routes instead.

Leave a comment