Commit ce5931b7 by Bagus Pambudi

ubah category bahasa asing

parent 9aafb0c6
...@@ -25,21 +25,21 @@ class CategoryController extends Controller ...@@ -25,21 +25,21 @@ class CategoryController extends Controller
return view('webprofile.front.'.$setting['theme'].'.archive', $data)->withTitle($category); return view('webprofile.front.'.$setting['theme'].'.archive', $data)->withTitle($category);
} elseif (Session::get('selected_language') == 'en') { } elseif (Session::get('selected_language') == 'en') {
$data = $this->getDataEn($setting, $category); $data = $this->getDataEn($setting, $category);
return view('webprofile.front.'.$setting['theme'].'.en.archive', $data)->withTitle($category); return view('webprofile.front.'.$setting['theme'].'.en.archive', $data)->withTitle($data['category']);
} elseif (Session::get('selected_language') == 'de') { } elseif (Session::get('selected_language') == 'de') {
$data = $this->getDataDe($setting, $category); $data = $this->getDataDe($setting, $category);
return view('webprofile.front.'.$setting['theme'].'.de.archive', $data)->withTitle($category); return view('webprofile.front.'.$setting['theme'].'.de.archive', $data)->withTitle($data['category']);
} elseif (Session::get('selected_language') == 'ar') { } elseif (Session::get('selected_language') == 'ar') {
$data = $this->getDataSa($setting, $category); $data = $this->getDataSa($setting, $category);
return view('webprofile.front.'.$setting['theme'].'.ar.archive', $data)->withTitle($category); return view('webprofile.front.'.$setting['theme'].'.ar.archive', $data)->withTitle($data['category']);
} elseif (Session::get('selected_language') == 'zh') { } elseif (Session::get('selected_language') == 'zh') {
$data = $this->getDataZh($setting, $category); $data = $this->getDataZh($setting, $category);
return view('webprofile.front.'.$setting['theme'].'.zh.archive', $data)->withTitle($category); return view('webprofile.front.'.$setting['theme'].'.zh.archive', $data)->withTitle($data['category']);
} }
} }
...@@ -74,7 +74,8 @@ class CategoryController extends Controller ...@@ -74,7 +74,8 @@ class CategoryController extends Controller
public function getDataEn($setting, $category) public function getDataEn($setting, $category)
{ {
$setting = webprofilesetting(); $setting = webprofilesetting();
$findCategory = Categories::where('name', $category)->first(); $findCategory = Categories::with(['rEn'])->where('name', $category)->first();
// dd($findCategory);
$data = Posts::with(['rEn'])->where('categories', $findCategory->id)->where('post_status', '1')->orderBy('post_date', 'desc')->paginate($setting['post_per_page']); $data = Posts::with(['rEn'])->where('categories', $findCategory->id)->where('post_status', '1')->orderBy('post_date', 'desc')->paginate($setting['post_per_page']);
$resend = Posts::with(['rEn'])->where('post_status', '1')->orderby('post_date', 'desc')->limit('5')->get(); $resend = Posts::with(['rEn'])->where('post_status', '1')->orderby('post_date', 'desc')->limit('5')->get();
$hot = Posts::with(['rEn'])->where('post_status', '1')->orderby('viewer', 'desc')->limit('5')->get(); $hot = Posts::with(['rEn'])->where('post_status', '1')->orderby('viewer', 'desc')->limit('5')->get();
...@@ -94,6 +95,7 @@ class CategoryController extends Controller ...@@ -94,6 +95,7 @@ class CategoryController extends Controller
'hot' => $hot, 'hot' => $hot,
'categories' => $categories, 'categories' => $categories,
'footer' => $footer, 'footer' => $footer,
'category' => $findCategory->rEn->name,
]; ];
return $data; return $data;
...@@ -102,7 +104,7 @@ class CategoryController extends Controller ...@@ -102,7 +104,7 @@ class CategoryController extends Controller
public function getDataDe($setting, $category) public function getDataDe($setting, $category)
{ {
$setting = webprofilesetting(); $setting = webprofilesetting();
$findCategory = Categories::where('name', $category)->first(); $findCategory = Categories::with(['rDe'])->where('name', $category)->first();
$data = Posts::with(['rDe'])->where('categories', $findCategory->id)->where('post_status', '1')->orderBy('post_date', 'desc')->paginate($setting['post_per_page']); $data = Posts::with(['rDe'])->where('categories', $findCategory->id)->where('post_status', '1')->orderBy('post_date', 'desc')->paginate($setting['post_per_page']);
$resend = Posts::with(['rDe'])->where('post_status', '1')->orderby('post_date', 'desc')->limit('5')->get(); $resend = Posts::with(['rDe'])->where('post_status', '1')->orderby('post_date', 'desc')->limit('5')->get();
$hot = Posts::with(['rDe'])->where('post_status', '1')->orderby('viewer', 'desc')->limit('5')->get(); $hot = Posts::with(['rDe'])->where('post_status', '1')->orderby('viewer', 'desc')->limit('5')->get();
...@@ -122,6 +124,7 @@ class CategoryController extends Controller ...@@ -122,6 +124,7 @@ class CategoryController extends Controller
'hot' => $hot, 'hot' => $hot,
'categories' => $categories, 'categories' => $categories,
'footer' => $footer, 'footer' => $footer,
'category' => $findCategory->rDe->name,
]; ];
return $data; return $data;
...@@ -130,7 +133,7 @@ class CategoryController extends Controller ...@@ -130,7 +133,7 @@ class CategoryController extends Controller
public function getDataSa($setting, $category) public function getDataSa($setting, $category)
{ {
$setting = webprofilesetting(); $setting = webprofilesetting();
$findCategory = Categories::where('name', $category)->first(); $findCategory = Categories::with(['rSa'])->where('name', $category)->first();
$data = Posts::with(['rSa'])->where('categories', $findCategory->id)->where('post_status', '1')->orderBy('post_date', 'desc')->paginate($setting['post_per_page']); $data = Posts::with(['rSa'])->where('categories', $findCategory->id)->where('post_status', '1')->orderBy('post_date', 'desc')->paginate($setting['post_per_page']);
$resend = Posts::with(['rSa'])->where('post_status', '1')->orderby('post_date', 'desc')->limit('5')->get(); $resend = Posts::with(['rSa'])->where('post_status', '1')->orderby('post_date', 'desc')->limit('5')->get();
$hot = Posts::with(['rSa'])->where('post_status', '1')->orderby('viewer', 'desc')->limit('5')->get(); $hot = Posts::with(['rSa'])->where('post_status', '1')->orderby('viewer', 'desc')->limit('5')->get();
...@@ -150,6 +153,7 @@ class CategoryController extends Controller ...@@ -150,6 +153,7 @@ class CategoryController extends Controller
'hot' => $hot, 'hot' => $hot,
'categories' => $categories, 'categories' => $categories,
'footer' => $footer, 'footer' => $footer,
'category' => $findCategory->rSa->name,
]; ];
return $data; return $data;
...@@ -158,7 +162,7 @@ class CategoryController extends Controller ...@@ -158,7 +162,7 @@ class CategoryController extends Controller
public function getDataZh($setting, $category) public function getDataZh($setting, $category)
{ {
$setting = webprofilesetting(); $setting = webprofilesetting();
$findCategory = Categories::where('name', $category)->first(); $findCategory = Categories::with(['rZh'])->where('name', $category)->first();
$data = Posts::with(['rZh'])->where('categories', $findCategory->id)->where('post_status', '1')->orderBy('post_date', 'desc')->paginate($setting['post_per_page']); $data = Posts::with(['rZh'])->where('categories', $findCategory->id)->where('post_status', '1')->orderBy('post_date', 'desc')->paginate($setting['post_per_page']);
$resend = Posts::with(['rZh'])->where('post_status', '1')->orderby('post_date', 'desc')->limit('5')->get(); $resend = Posts::with(['rZh'])->where('post_status', '1')->orderby('post_date', 'desc')->limit('5')->get();
$hot = Posts::with(['rZh'])->where('post_status', '1')->orderby('viewer', 'desc')->limit('5')->get(); $hot = Posts::with(['rZh'])->where('post_status', '1')->orderby('viewer', 'desc')->limit('5')->get();
...@@ -178,6 +182,7 @@ class CategoryController extends Controller ...@@ -178,6 +182,7 @@ class CategoryController extends Controller
'hot' => $hot, 'hot' => $hot,
'categories' => $categories, 'categories' => $categories,
'footer' => $footer, 'footer' => $footer,
'category' => $findCategory->rZh->name,
]; ];
return $data; return $data;
......
...@@ -4,15 +4,11 @@ ...@@ -4,15 +4,11 @@
<section class="post-wrapper-top jt-shadow clearfix"> <section class="post-wrapper-top jt-shadow clearfix">
<div class="container"> <div class="container">
<div class="col-lg-12"> <div class="col-lg-12">
@foreach($categories as $value) <h2 style="text-transform: capitalize;">{!! $title !!}</h2>
@if ($value->rSa)
<h2 style="text-transform: capitalize;">{!! $value->rSa->name !!}</h2>
<ul class="breadcrumb pull-right"> <ul class="breadcrumb pull-right">
<li><a href="{{'/'}}" style="text-transform: capitalize;">الصفحة الرئيسية</a></li> <li><a href="{{'/'}}" style="text-transform: capitalize;">الصفحة الرئيسية</a></li>
<li style="text-transform: capitalize;">الفئة</li> <li style="text-transform: capitalize;">الفئة</li>
</ul> </ul>
@endif
@endforeach
</div> </div>
</section><!-- end post-wrapper-top --> </section><!-- end post-wrapper-top -->
......
...@@ -4,15 +4,11 @@ ...@@ -4,15 +4,11 @@
<section class="post-wrapper-top jt-shadow clearfix"> <section class="post-wrapper-top jt-shadow clearfix">
<div class="container"> <div class="container">
<div class="col-lg-12"> <div class="col-lg-12">
@foreach($categories as $value) <h2 style="text-transform: capitalize;">{!! $title !!}</h2>
@if ($value->rDe)
<h2 style="text-transform: capitalize;">{!! $value->rDe->name !!}</h2>
<ul class="breadcrumb pull-right"> <ul class="breadcrumb pull-right">
<li><a href="{{'/'}}" style="text-transform: capitalize;">Heim</a></li> <li><a href="{{'/'}}" style="text-transform: capitalize;">Heim</a></li>
<li style="text-transform: capitalize;">Kategorie</li> <li style="text-transform: capitalize;">Kategorie</li>
</ul> </ul>
@endif
@endforeach
</div> </div>
</div> </div>
</section><!-- end post-wrapper-top --> </section><!-- end post-wrapper-top -->
......
...@@ -4,15 +4,14 @@ ...@@ -4,15 +4,14 @@
<section class="post-wrapper-top jt-shadow clearfix"> <section class="post-wrapper-top jt-shadow clearfix">
<div class="container"> <div class="container">
<div class="col-lg-12"> <div class="col-lg-12">
@foreach($categories as $value)
@if ($value->rEn) <h2 style="text-transform: capitalize;">{!! $title !!}</h2>
<h2 style="text-transform: capitalize;">{!! $value->rEn->name !!}</h2>
<ul class="breadcrumb pull-right"> <ul class="breadcrumb pull-right">
<li><a href="{{'/'}}" style="text-transform: capitalize;">Home</a></li> <li><a href="{{'/'}}" style="text-transform: capitalize;">Home</a></li>
<li style="text-transform: capitalize;">Category</li> <li style="text-transform: capitalize;">Category</li>
</ul> </ul>
@endif
@endforeach
</div> </div>
</div> </div>
</section><!-- end post-wrapper-top --> </section><!-- end post-wrapper-top -->
......
...@@ -4,15 +4,11 @@ ...@@ -4,15 +4,11 @@
<section class="post-wrapper-top jt-shadow clearfix"> <section class="post-wrapper-top jt-shadow clearfix">
<div class="container"> <div class="container">
<div class="col-lg-12"> <div class="col-lg-12">
@foreach($categories as $value) <h2 style="text-transform: capitalize;">{!! $title !!}</h2>
@if ($value->rZh)
<h2 style="text-transform: capitalize;">{!! $value->rZh->name !!}</h2>
<ul class="breadcrumb pull-right"> <ul class="breadcrumb pull-right">
<li><a href="{{'/'}}" style="text-transform: capitalize;">家</a></li> <li><a href="{{'/'}}" style="text-transform: capitalize;">家</a></li>
<li style="text-transform: capitalize;">类别</li> <li style="text-transform: capitalize;">类别</li>
</ul> </ul>
@endif
@endforeach
</div> </div>
</div> </div>
</section><!-- end post-wrapper-top --> </section><!-- end post-wrapper-top -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment