public function update($id, $data) { $view = $this->get($id); $coder = new \Cms\Library\Helpers\Coder\ViewsCoder(); $coder->deleteView($view); return parent::update($id, $data); }
public function update($id, $data) { $definition = $this->get($id); if ($definition->type == 'image' && $data['file']) { $image = \ImageDriver::store(['file' => $data['file']]); $data['image_id'] = $image->id; } return parent::update($id, $data); }