public function delete($page_id) { $page = Model\Page::findOrFail($page_id); $page->delete(); set_message_success('Halaman berhasil dihapus.'); redirect('pages', 'refresh'); }
/** * Demo function, this is how you get all Pages * @return array */ public function getPages() { if (!$this->hasAccessToken()) { throw new \InvalidArgumentException('access token missing'); } return Model\Page::find('all', $this->getConnection()); }