update on laravel

0

Good afternoon everyone! I created the form, which will send to the "update" method of laravel

public function update(Request $r, Voluntarios $vol)
  {   
      $up = $vol->update($r->all());
      var_dump($up);
  }

But it returns false, without saving ... what's wrong ??? I'm still learning, and I'm a little lost yet ... Thank you all!! Horacio

    
asked by anonymous 18.11.2017 / 19:18

1 answer

0

Modify the code as below:


public function update(Request $r, Voluntarios $vol)
  {   
      $up = $vol->fill($r->all());
      $vol->save();
      var_dump($up);
  }
    
18.11.2017 / 20:58