public function postUpdateItem(Request $request, $model, $id)
 {
     $item = call_user_func(array($this->class_name, 'find'), $id);
     if (!$item) {
         $item = new $this->class_name();
         $item->id = $this->item_id;
     }
     CrudUtilities::fillItem($request, $item, $this->fields);
     return redirect($this->route_url . '/items');
 }
Ejemplo n.º 2
0
 public function postUpdateItem(Request $request)
 {
     $routeParams = Route::current()->parameters();
     $id = $routeParams['id'];
     $item = call_user_func(array($this->class_name, 'findOrFail'), $id);
     CrudUtilities::fillItem($request, $item, $this->edit_fields);
     CrudUtilities::updateAlias($request, $item, $this->fields);
     $this->onUpdateItem($request, $item);
     return redirect($this->route_url . '/items');
 }