public function getSettings()
    {
        $settings = Settings::all()->keyBy('settingsKey');

        $settings['defaultLanguage'] = (object) array('value' => Language::getDefault()->languageID);

        if(isset($settings['logo'])) {
            $media = Media::where('mediaID', $settings['logo']->value)->select("mediaID", "type", "filename", "fileDirectory")->first();
            if ($media) {
                $settings['logo']['media'] = $media;
            }
            $watermark = Media::where('mediaID', $settings['watermark']->value)->select("mediaID", "type", "filename", "fileDirectory")->first();
            if ($watermark) {
                $settings['watermark']['media'] = $watermark;
            }
        }
        // user groups
        $userGroups = UserGroup::all();
        // get all posts
        $posts = DB::table('post_pages')->select("postID", "title", "slug")->get();
        $posts = Language::filterRows($posts, false);
        // theme configs
        $themeConfigs = Theme::configs();

        return [
            'settings' => $settings,
            'userGroups' => $userGroups,
            'pages' => $posts,
            'themeConfigs' => $themeConfigs,
        ];
    }
public function getSettings()
    {
        $settings = Settings::all()->keyBy('settingsKey');

        $settings['defaultLanguage'] = (object) array('value' => Language::getDefault()->languageID);

        if(isset($settings['logo'])) {
            $media = Media::where('mediaID', $settings['logo']->value)->select("mediaID", "type", "filename", "fileDirectory")->first();
            if ($media) {
                $settings['logo']['media'] = $media;
            }
            $watermark = Media::where('mediaID', $settings['watermark']->value)->select("mediaID", "type", "filename", "fileDirectory")->first();
            if ($watermark) {
                $settings['watermark']['media'] = $watermark;
            }
        }
        // user groups
        $userGroups = UserGroup::all();
        // get all posts
        $posts = DB::table('post_pages')->select("postID", "title", "slug")->get();
        $posts = Language::filterRows($posts, false);
        // theme configs
        $themeConfigs = Theme::configs();

        return [
            'settings' => $settings,
            'userGroups' => $userGroups,
            'pages' => $posts,
            'themeConfigs' => $themeConfigs,
        ];
    }
public function getSettings ( ) { $ settings = Settings :: all ( ) -> keyBy ( 'settingsKey' ) ; $ settings [ 'defaultLanguage' ] = ( object ) array ( 'value' => Language :: getDefault ( ) -> languageID ) ; if ( isset ( $ settings [ 'logo' ] ) ) { $ media = Media :: where ( 'mediaID' , $ settings [ 'logo' ] -> value ) -> select ( "mediaID" , "type" , "filename" , "fileDirectory" ) -> first ( ) ; if ( $ media ) { $ settings [ 'logo' ] [ 'media' ] = $ media ; } $ watermark = Media :: where ( 'mediaID' , $ settings [ 'watermark' ] -> value ) -> select ( "mediaID" , "type" , "filename" , "fileDirectory" ) -> first ( ) ; if ( $ watermark ) { $ settings [ 'watermark' ] [ 'media' ] = $ watermark ; } } // user groups $ userGroups = UserGroup :: all ( ) ; // get all posts $ posts = DB :: table ( 'post_pages' ) -> select ( "postID" , "title" , "slug" ) -> get ( ) ; $ posts = Language :: filterRows ( $ posts , false ) ; // theme configs $ themeConfigs = Theme :: configs ( ) ; return [ 'settings' => $ settings , 'userGroups' => $ userGroups , 'pages' => $ posts , 'themeConfigs' => $ themeConfigs , ] ; }
Get list of all settings and corresponding data, languages for language images etc.

@return array
@throws \Exception
Get list of all settings and corresponding data languages for language images etc .