if($htmlText == '') return $htmlText;
libxml_use_internal_errors(true);
$doc = new \DOMDocument();
- $doc->loadHTML($htmlText);
+ $doc->loadHTML(mb_convert_encoding($htmlText, 'HTML-ENTITIES', 'UTF-8'));
$container = $doc->documentElement;
$body = $container->childNodes->item(0);
$page->delete();
}
+ /**
+ * Get the latest pages added to the system.
+ * @param $count
+ */
+ public function getRecentlyCreatedPaginated($count = 20)
+ {
+ return $this->page->orderBy('created_at', 'desc')->paginate($count);
+ }
+
+ /**
+ * Get the latest pages added to the system.
+ * @param $count
+ */
+ public function getRecentlyUpdatedPaginated($count = 20)
+ {
+ return $this->page->orderBy('updated_at', 'desc')->paginate($count);
+ }
- }
+ }