src/Gzero/Cms/Repositories/ContentReadRepository.php
public function getChildren(Content $content, Language $language)
    {
        return $content->children()
            ->with(self::$loadRelations)
            ->where('published_at', '<=', Carbon::now())
            ->whereHas('routes', function ($query) use ($language) {
                $query->where('routes.is_active', true)
                    ->where('language_code', $language->code);
            })
            ->orderBy('is_promoted', 'DESC')
            ->orderBy('is_sticky', 'DESC')
            ->orderBy('weight', 'ASC')
            ->orderBy('published_at', 'DESC')
            ->paginate(option('general', 'default_page_size', 20));
    }
public function getChildren(Content $content, Language $language)
    {
        return $content->children()
            ->with(self::$loadRelations)
            ->where('published_at', '<=', Carbon::now())
            ->whereHas('routes', function ($query) use ($language) {
                $query->where('routes.is_active', true)
                    ->where('language_code', $language->code);
            })
            ->orderBy('is_promoted', 'DESC')
            ->orderBy('is_sticky', 'DESC')
            ->orderBy('weight', 'ASC')
            ->orderBy('published_at', 'DESC')
            ->paginate(option('general', 'default_page_size', 20));
    }
public function getChildren ( Content $ content , Language $ language ) { return $ content -> children ( ) -> with ( self :: $ loadRelations ) -> where ( 'published_at' , '<=' , Carbon :: now ( ) ) -> whereHas ( 'routes' , function ( $ query ) use ( $ language ) { $ query -> where ( 'routes.is_active' , true ) -> where ( 'language_code' , $ language -> code ) ; } ) -> orderBy ( 'is_promoted' , 'DESC' ) -> orderBy ( 'is_sticky' , 'DESC' ) -> orderBy ( 'weight' , 'ASC' ) -> orderBy ( 'published_at' , 'DESC' ) -> paginate ( option ( 'general' , 'default_page_size' , 20 ) ) ; }
Get all children specific content

@param Content  $content  parent
@param Language $language Current language

@return mixed
Get all children specific content