form submit through ajax

Posted in CategoryLaravel
  • R
    Rajinder 10 months ago

    I am try to insert form value into database using ajax but unable.I got message in success when insert query is commented.Otherwise it genrate 500 internal server error.




    public function commentpost(Request $request){

    $input = request()->all();

    $postid= $input['postid'];

    $comment= $input['comment'];


    return response()->json(['success'=>'Ajax working fine']);



  • S
    Shruti 10 months ago

    use create instead of insert and check.


Please login or register to leave a response.

* You May Also Like Bellow Issue to check *