<li>{!! Lang::get('lang.you_are_here') !!}: </li> <li>{!! Lang::get('lang.home') !!}</li> <li>{!! Lang::get('lang.knowledge_base') !!}</li> </ol> </div> @stop <div id="content" class="site-content col-md-9"> <div class="row"> <?php $categories = App\Model\kb\Category::all(); ?> @foreach($categorys as $category) {{-- get the article_id where category_id == current category --}} <?php $all = App\Model\kb\Relationship::all(); /* from whole attribute pick the article_id */ $page = App\Model\kb\Relationship::where('category_id', '=', $category->id)->paginate('3'); /* from whole attribute pick the article_id */ $article_id = $page->lists('article_id'); $count = count($article_id); ?> <div class="col-md-6"> <section class="box-categories"> <h1 class="section-title h4 clearfix"> <i class="fa fa-folder-open-o fa-fw text-muted"></i> <small class="pull-right"><i class="fa fa-hdd-o fa-fw"></i></small> {{$category->name}} </h1> <ul class="fa-ul"> <?php