this.obPopupWin = BX.PopupWindowManager.create('CatalogSectionBasket_' + this.visual.ID, null, {
darkMode: false,
autoHide: true,
offsetLeft: 0,
offsetTop: 0,
overlay : false,
closeByEsc: false,
titleBar: true
}); BX.PopupWindowManager.create()popup = $(this.obPopupWin.popupContainer);return $this->morphMany('App\Models\Comment', 'material')->selectRaw('material_id, count(*) as count')->groupBy('material_id'); $posts = Post::with('commentsCount')->get();select count(*) as count from `comments` where `comments`.`material_id` in ('10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21') and `comments`.`material_type` = 'App\Models\Post'public function commentsCount() {
return $this->morphMany('App\Models\Comment', 'material')->selectRaw('count(*) as count');
}