[Vuejs]-Cant't query json data in laravel 5.2

0๐Ÿ‘

โœ…

A better way to do it would just be to send this.editingcontact as the data:

updatecontact:function(){
  var contactid = this.editingcontact.id;
  this.$http({url: '/adressbook/'+contactid, data: this.editingcontact , method: 'PATCH'})
  .then(function (response) {
    console.log(response);
  }, function (response) {
  // error callback
});

Then this update code should work:

public function update(Request $request, $id)
{
 $adressbook = Adressbook::findOrFail($id);
 $adressbook->update($request->all());
}

Leave a comment