public static function setHomepage()
    {
        if(!self::$homepage) {
            $findHomePage = null;
            if (settings('homepageID')) {
                $findHomePage = (new Post())->setTable("post_pages")
                    ->where('postID', settings('homepageID'))
                    ->first();
            }

            // get the first found page if no homepage is defined
            if (!$findHomePage) {
                $findHomePage = (new Post())->setTable("post_pages")->first();
            }

            if(!$findHomePage) {
                throw new \Exception("No homepage found. Please add a page post!");
            }
            self::$homepage = $findHomePage;

        }

        return self::$homepage;
    }
public static function setHomepage()
    {
        if(!self::$homepage) {
            $findHomePage = null;
            if (settings('homepageID')) {
                $findHomePage = (new Post())->setTable("post_pages")
                    ->where('postID', settings('homepageID'))
                    ->first();
            }

            // get the first found page if no homepage is defined
            if (!$findHomePage) {
                $findHomePage = (new Post())->setTable("post_pages")->first();
            }

            if(!$findHomePage) {
                throw new \Exception("No homepage found. Please add a page post!");
            }
            self::$homepage = $findHomePage;

        }

        return self::$homepage;
    }
public static function setHomepage ( ) { if ( ! self :: $ homepage ) { $ findHomePage = null ; if ( settings ( 'homepageID' ) ) { $ findHomePage = ( new Post ( ) ) -> setTable ( "post_pages" ) -> where ( 'postID' , settings ( 'homepageID' ) ) -> first ( ) ; } // get the first found page if no homepage is defined if ( ! $ findHomePage ) { $ findHomePage = ( new Post ( ) ) -> setTable ( "post_pages" ) -> first ( ) ; } if ( ! $ findHomePage ) { throw new \ Exception ( "No homepage found. Please add a page post!" ) ; } self :: $ homepage = $ findHomePage ; } return self :: $ homepage ; }
Get Home Page's data.
Home is supposed to be served form post_pages post type.

@return object
@throws \Exception
Get Home Page s data . Home is supposed to be served form post_pages post type .