]> _ Git - cubist_cms-back.git/commitdiff
Merge remote-tracking branch 'origin/master'
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 10 Jul 2019 10:01:32 +0000 (12:01 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 10 Jul 2019 10:01:32 +0000 (12:01 +0200)
1  2 
src/app/Http/Controllers/CubistFrontController.php

index 7319b1c9fb68790f2f8960a9ac4bb8cafc9d7a8d,1fd8bce7f13b185883a3aef490f932230f009de9..9b3f836eb9092ecc2dd6184834d7b249b68290c3
@@@ -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 <a href="' . url('') . '">homepage</a>.');