public function updateContent($id) { $newContent = Input::get('newContent'); $contentRow = Content::findOrFail($id); // Create history backup $backup = new ContentHistory(); $backup->content = $contentRow->content; $backup->originalId = $id; $backup->contentTypeSlug = $contentRow->contentTypeSlug; $backup->parentId = $contentRow->parentId; $backup->save(); $contentRow->content = $newContent; $contentRow->save(); return $contentRow->content; }
public function createPlaceholderContent($pageId, $contentType) { $content = new Content(); $content->content = $contentType['placeholder']; $content->contentTypeSlug = $contentType['name']; $content->parentId = $pageId; $content->save(); }