[Vuejs]-Axios post fails with status code 500 in Laravel and Vue.js

0👍

bind your code in try catch block like this and see the network tab what you get in the response…then you can search for the error or give us a snippet so that we can help you

try {
                $parent=new parents();
           $parent->name=$request->name;
           $parent->save();
                return response()->json(['success' => $parent], 200);
            } catch (\Exception $e) {
                return response()->json(['error' => $e->getMessage()], 503);
            }

Leave a comment