Answers for "update any field from request laravel"

0

update any field from request laravel

// app/controllers/GiftsController.php

public function update($id)
{
  // Grab all the input passed in
  $data = Input::all();

  // Use Eloquent to grab the gift record that we want to update,
  // referenced by the ID passed to the REST endpoint
  $gift = Gift::find($id);

  // Call fill on the gift and pass in the data
  $gift->fill($data);

  $gift->save();
}
Posted by: Guest on July-16-2021

Code answers related to "update any field from request laravel"

Browse Popular Code Answers by Language