jquery-3.3.1.js:9600 POST http://127.0.0.1:8000/api/edit-data 500 (Internal Server Error) : With the help of Jquery ajax i am trying to edit the data in the form.
According to other solutions, i have already included csrf token in both meta and ajax setup.

```
$.ajaxSetup({
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    }
           });```
In header

<meta name="csrf-token" content="{{ csrf_token() }}">
```

```
          $.ajax({
             type : "POST",
             url: "{{url('api/edit-data')}}",
             data : {
                id : id,
                name: name,
                contact: contact,
                email: email,
                valley: valley,
                paddress: paddress,
                taddress: taddress,
                qualification: qualification,
                ts: ts,
                experiences: experiences,
                tob: tob,
                es: es,
                level: level,
                ey: ey,
                cn: cn,
                cv: cv,
                },
              
             
             success: function(res)
             {
               console.log(res.sessiondata);
              //  alert('successful');
             }
           });
});
```

controller
```
 public function editdata(Request $request)
    {
        
        $id = $request->id;
        $data['name'] = $request->name;
        $data['contact'] = $request->contact;
        $data['email'] = $request->email;
        $data['valley'] =$request->valley;
        $data['paddress'] = $request->paddress;
        $data['taddress'] = $request->taddress;
        $data['qualification'] = $request->qualification;
        $data['ts'] =  $request->ts;
        $data['experiences'] = $request->experiences;
        $data['tob'] = $request->tob;
        $data['es'] = $request->es;
        $data['level'] = $request->level;
        $data['ey'] = $request->ey;
        $data['cn'] = $request->cn;
        $data['cv'] = $request->cv;
        if(cv::find($id)->update($data))
        {
            return response([
                'sessiondata' => $data
            ]);
        }else{
        return response([
            'sessiondata'=> $request->name
        ]);
        }

    }
```
Actual error
POST http://127.0.0.1:8000/api/edit-data 500 (Internal Server Error)

There's already a lots of solution regarding this error.
I have followed them accordingly but i still get this error.
I have already include csrf_token both in header in jquery too.
Thanks for help.
