From: Vincent Vanwaelscappel Date: Wed, 10 Jul 2019 10:01:32 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/master' X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2008ccec272f88d7401eb4a0d034e3dcd6778833;p=cubist_cms-back.git Merge remote-tracking branch 'origin/master' --- 2008ccec272f88d7401eb4a0d034e3dcd6778833 diff --cc src/app/Http/Controllers/CubistFrontController.php index 7319b1c,1fd8bce..9b3f836 --- a/src/app/Http/Controllers/CubistFrontController.php +++ b/src/app/Http/Controllers/CubistFrontController.php @@@ -14,24 -12,9 +14,24 @@@ class CubistFrontController extends Bas public function __construct() { - $this->data['global'] = Settings::find(1); + $this->data['global'] = Settings::find(1)->withFakes()->getDecodedAttributes(); } + public function index($slug = 'home') + { + $class = CMSPage::getPageClass(); + $page = $class::findBySlug($slug); + + if (!$page) { + $this->_404(); + } + + $this->data['title'] = $page->title; + $this->data['page'] = $page->withFakes()->getDecodedAttributes(); + + return view('pages.' . $page->template, $this->data); + } + protected function _404() { abort(404, 'Please go back to our homepage.');