I am having some strange problem with axios I never had before, any returned response from laravel backend to vue frontend is empty..
return response()->json(['message' => 'Success!']);
This line is just after the post is edited...
I also tried:
return response(['message' => 'Success!']);
return ['message' => 'Success!'];
And when I console.log()
response:
axios.post(url).then((response)=>{
console.log(response);
});
I get everything about response and data as empty string, I am having this problem in Laravel 5.7 where in 5.6 works just fine...
In you blade make sure you have
csrf_token
in the headxyz.blade.php
From Vue or React: Make sure your method is right get, post, delete, put in routes file (
web.php
or anything)Inside Controller :
Alternatively you can also debug Right click on browser >> Inspect >> Network tab >> Refer to screenshot.
You can also
dd($response)
your response and view in the inspector in response section