public function update($id) { $db = Keyword::find($id); $db->name = \Input::get('name'); $db->keyword = \Input::get('keyword'); $db->url = \Input::get('url'); if (\Input::has('gname')) { $dbgroup = Group::firstOrCreate(['Name' => \Input::get('gname')]); $joingroup_id = $dbgroup->ID; } else { $joingroup_id = ''; } $db->joingroup_id = $joingroup_id; $db->text_reply = \Input::get('text_reply'); $db->save(); return \Response::json(['id' => $db->id]); }
public function update($id) { $db = Contact::find($id); $db->Name = \Input::get('name'); $db->Number = \Input::get('number'); if (\Input::has('group')) { $dbgroup = Group::firstOrCreate(['Name' => \Input::get('group')]); $db->GroupID = $dbgroup->ID; } else { $db->GroupID = '-1'; } $db->save(); return \Response::json(['id' => $db->ID]); }