<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 foreach ($article_id as $id) { $article = App\Model\kb\Article::where('id', '=', $id)->where('status', '=', '1')->where('type', '=', '1')->get();
@extends('themes.default1.client.layout.client') @section('breadcrumb') <?php $all = App\Model\kb\Relationship::where('article_id', '=', $arti->id)->get(); /* from whole attribute pick the article_id */ $category_id = $all->lists('category_id'); ?> <div class="site-hero clearfix"> <ol class="breadcrumb breadcrumb-custom"> <li class="text">{!! Lang::get('lang.you_are_here') !!}: </li> <?php $category = App\Model\kb\Category::where('id', $category_id)->first(); ?> <li><a href="{{url('/')}}">{!! Lang::get('lang.home') !!}</a></li> <li><a href="{{url('category-list')}}">{!! Lang::get('lang.category') !!}</a></li> <li><a href="{{url('category-list/'.$category->slug)}}">{{$category->name}}</a></li> <li class="active">{{$arti->name}}</li> </ol> </div> @stop @section('content') <div id="content" class="site-content col-md-9"> <!-- <article class=" type-post format-standard hentry clearfix"> <h1 class="post-title"><a href="#">{{$arti->name}}</a></h1> <div class="post-meta clearfix"> <span class="date">{{$arti->created_at}}</span>
@section('content') <div id="content" class="site-content col-md-12"> <!-- Start of Page Container --> <div class="row home-listing-area"> <div class="span8"> <h2>{!! Lang::get('lang.categories') !!}</h2> </div> </div> <div class="row separator"> @foreach($categorys as $category) <div class="col-xs-6"> {{-- get the article_id where category_id == current category --}} <?php $all = App\Model\kb\Relationship::where('category_id', $category->id)->get(); //dd($all); /* from whole attribute pick the article_id */ $article_id = $all->lists('article_id'); ?> <section class="articles-list"> <h3><i class="fa fa-folder-open-o fa-fw text-muted"></i> <a href="{{url('category-list/'.$category->slug)}}">{{$category->name}}</a> <span>({{count($all)}})</span></h3> <ul class="articles"> <hr> <?php foreach ($article_id as $id) { ?> <?php $article = App\Model\kb\Article::where('id', $id)->get(); $article = $article->where('status', 1);