where('tags_id', $record->id)->count(); } if (Schema::hasTable('indikator_content_news')) { $count += Db::table('indikator_content_tags_news')->where('tags_id', $record->id)->count(); } if (Schema::hasTable('indikator_content_portfolio')) { $count += Db::table('indikator_content_tags_portfolio')->where('tags_id', $record->id)->count(); } echo $count;