@@ -63,12 +63,12 @@ public function index($locale, $category_slug = null, Request $request)
63
63
\View::share ('binshopsblog_category ' , $ category ); // so the view can say "You are viewing $CATEGORYNAME category posts"
64
64
$ title = 'Posts in ' . $ category ->category_name . " category " ; // hardcode title here...
65
65
} else {
66
- $ posts = BinshopsPostTranslation::where ( ' lang_id ' , $ request -> get ( " lang_id " ) )
67
- ->with ([ ' post ' => function ( $ query ){
68
- $ query ->where ("is_published " , '= ' , true );
69
- $ query ->where ('posted_at ' , '< ' , Carbon::now ()->format ('Y-m-d H:i:s ' ));
70
- $ query ->orderBy ("posted_at " , "desc " );
71
- }]) ->paginate (config ("binshopsblog.per_page " , 10 ));
66
+ $ posts = BinshopsPostTranslation::join ( ' binshops_posts ' , ' binshops_post_translations.post_id ' , ' = ' , ' binshops_posts.id ' )
67
+ ->where ( ' lang_id ' , $ request -> get ( " lang_id " ))
68
+ ->where ("is_published " , '= ' , true )
69
+ ->where ('posted_at ' , '< ' , Carbon::now ()->format ('Y-m-d H:i:s ' ))
70
+ ->orderBy ("posted_at " , "desc " )
71
+ ->paginate (config ("binshopsblog.per_page " , 10 ));
72
72
}
73
73
74
74
//load category hierarchy
0 commit comments