Whole lotta pub_settings

PHOTO EMBED

Thu Sep 30 2021 17:10:31 GMT+0000 (UTC)

Saved by @dustbuster #php

/**
     * Query Public schema and return any req'd settings.
     */
    public static function getSettingsFromPublic()
    {
        if (Schema::connection('public')->hasTable('pubs')) {
            DB::table('public.pubs_settings')->select('ps.id, LOWER(ps.name) AS name, ps.description, ps.value, ps.resolve_include_path, ps.set_as_null, psc.name AS category, cst.name AS type, cse.name AS element')->join('components_settings_types_elements cste', 'cste.id', 'ps.components_settings_types_elements_id')->where('psc.name', 'css')->orderBy('ps.name', 'ASC')->get();
            $statement = "SELECT ps.id, LOWER(ps.name) AS name, ps.description, ps.value, ps.resolve_include_path, ps.set_as_null, psc.name AS category, cst.name AS type, cse.name AS element FROM pubs_settings ps JOIN pubs_settings_categories psc ON (psc.id = ps.pubs_settings_categories_id) JOIN components_settings_types_elements cste ON (cste.id = ps.components_settings_types_elements_id) JOIN components_settings_types cst ON (cst.id = cste.components_settings_types_id) JOIN components_settings_elements cse ON (cse.id = cste.components_settings_elements_id) WHERE psc.name = 'css' ORDER BY ps.name ASC";
            $data = DB::connection('public')->statement($statement);
        }
    }
content_copyCOPY

This is the massive queries I had to build. just wanted to save them somewhere.