Esempio n. 1
0
 /**
  * Update Informasi Departement
  *
  * @param $id
  *
  * @return mixed
  */
 public function update($id)
 {
     $db = $this->dept->find($id);
     $canUpdate = $db->canUpdate();
     if ($canUpdate) {
         /** @noinspection PhpUndefinedFieldInspection */
         $db->name = Input::get('name');
         /** @noinspection PhpUndefinedFieldInspection */
         $db->info = Input::get('info');
         /** @noinspection PhpUndefinedFieldInspection */
         $db->uuid = uniqid('Update_');
         $updated = $db->save();
         return $this->response($db->toArray(), $updated);
     }
     return $this->response(array(), $canUpdate);
 }