From edd25b422ea756e56bee8282e04076b3091d8955 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 17 Jan 2022 16:28:01 +0100 Subject: [PATCH] wip #5027 @0.25 --- app/Http/Controllers/FrontController.php | 13 ++++++++++++- app/Models/Settings.php | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/FrontController.php b/app/Http/Controllers/FrontController.php index 1c7f1e5..d71da10 100644 --- a/app/Http/Controllers/FrontController.php +++ b/app/Http/Controllers/FrontController.php @@ -7,6 +7,7 @@ use App\Models\AssetTheme; use App\Models\Menu; use App\Models\Publication; use App\Models\Resource; +use App\Models\Settings; use Cubist\Backpack\Magic\PageData; use Cubist\Util\Files\Files; @@ -59,7 +60,12 @@ class FrontController extends Controller protected function _getDataFromCMS() { - return ['menu' => $this->_getMenuFromCMS(), 'resources' => $this->_getResourcesFromCMS(), 'home' => $this->_getHomeFromCMS(), 'medialibrary' => $this->_getMediaLibraryFromCMS(), 'resources_pdf' => $this->_getResourcesPDFFromCMS()]; + return ['menu' => $this->_getMenuFromCMS(), + 'resources' => $this->_getResourcesFromCMS(), + 'home' => $this->_getHomeFromCMS(), + 'medialibrary' => $this->_getMediaLibraryFromCMS(), + 'resources_pdf' => $this->_getResourcesPDFFromCMS(), + 'settings' => $this->_getSettingsFromCMS()]; } protected function _getMenuFromCMS() @@ -121,4 +127,9 @@ class FrontController extends Controller { return Resource::find('1')->getPageData(); } + + protected function _getSettingsFromCMS() + { + return Settings::find('1')->getPageData(); + } } diff --git a/app/Models/Settings.php b/app/Models/Settings.php index 542ab0b..57e2df2 100644 --- a/app/Models/Settings.php +++ b/app/Models/Settings.php @@ -13,7 +13,7 @@ class Settings extends \Cubist\Backpack\Magic\Models\Settings public function setFields() { - $this->addField('pin', 'Text', 'Code PIN', ['pattern' => '\d{4}']); + $this->addField('pin', 'Text', 'Code PIN', ['pattern' => '\d{4}', 'translatable' => false, 'tab' => 'Splash']); } -- 2.39.5