@extends('layouts.front')
@section('contents')
 @section('meta')
<title>{{$searchKey}}</title>
<meta property="og:title" content="{{$searchKey}}" />
<meta property="og:image" content="{{asset('assets/images/'.$gs->og_baner)}}" />
@endsection	 

	 <!--==========ThemesBazar=============
                        Section-One Start
                    ==============ThemesBazar============-->
        <div class="all-section" ><!-- All Section-->

            <section class="archive-page">
                <div class="container">
                    <div class="row">
                        <div class="col-lg-8 col-md-8">                        
                            <div class="cat-info">
                                <ul>
                                    <li><a href="#"> <i class="las la-home"></i> /  </a></li>
                                    <li><a href="#"> {{$searchKey}}</a></li>
                                </ul>
                            </div>

                            

                            <div class="archive-wrpp">
                                
                                <div class="row">
                                    
                                				

                                  @if ($results->count()>0)
                            @foreach ($results as $post)
												
                                    <div class="col-lg-6 col-md-6">
                                        <div class="archive-items">
                                            <div class="archive-image2">
                                                <img class="lazyload" src="{{asset('assets/images/logo/'.$gs->lazy_baner)}}" data-src="{{asset('assets/images/post/'.$post->image_big)}}" alt="{{ strlen($post->title)>100 ? mb_substr($post->title,0,100,'utf-8').'...' : $post->title}}" title="{{ strlen($post->title)>100 ? mb_substr($post->title,0,100,'utf-8').'...' : $post->title}}">
                                                 

                                                <h6 class="archive-title2">
                                                    <a href="{{ route('frontend.postBySubcategory.details',[$post->category->slug,$post->slug])}}"> {{ strlen($post->title)>100 ? mb_substr($post->title,0,100,'utf-8').'...' : $post->title}}  </a>
                                                </h6>
                                            </div>
                                        

                                        </div>
                                    </div>
                                    									 
                                    @endforeach
                               @else
                                <div class="col-lg-12">
                                    <div class="card">
                                        <div class="card-body">
                                            <p class="text-danger text-danger text-center">{{__('কোন তথ্য পাওয়া যায়নি')}}</p>
                                        </div>
                                    </div>
                                </div>
                        @endif   
									
									
									
									
									
                                    
                                   
                                </div>
                                
                                
                               
                               
                               
                            </div>

                             <div style="text-align: center; float: right;"> {{ $results->links() }} </div>

                            <!-- <div class="archive-btn">
                                <a href=""> আরও পড়ুন </a>
                            </div> -->


                        </div>
                        <div class="col-lg-4 col-md-4">
                            <div class="sitebar-fixd" style="position: sticky; top: 0;"><!-- Fixd Siteber -->

                                
                                
                                


                                 <div class="nav nav-tabs " id="home-tab" role="tablist">

                            <div class="nav-link active" id="nav-home-tab" data-bs-toggle="tab" data-bs-target="#nav-home" role="tab" aria-controls="nav-home" aria-selected="false">  সর্বশেষ সংবাদ

                            </div>

                            <button class="nav-link " id="nav-profile-tab" data-bs-toggle="tab" data-bs-target="#nav-profile" type="button" role="tab" aria-controls="nav-profile" aria-selected="true"> আলোচিত সংবাদ </button>

                        

                        </div>
                                            
                                <div class="tab-content" id="myTabContent">

                            <div class="tab-pane fade active show" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab">

                                <div class="tavs">  

                                                                                         
                                                                                           @php
					$secondcat=DB::table('categories')->where('parent_id',null)->skip(1)->first();
					$secondcatpostbig=DB::table('posts')->where('category_id',$secondcat->id)->where('is_trending',1)->orderBy('id','DESC')->limit(1)->get();
					$secondcatpostsmall=DB::table('posts')->where('category_id',$secondcat->id)->where('is_trending',1)->orderBy('id','DESC')->skip(1)->limit(20)->get();
					@endphp                                          
                                    
@foreach ($secondcatpostsmall as $row)	
                                    <div class="tab-item"> <!-- tab Item Start-->                                  

                                        <div class="tab-image tab-border">

                                            <img class="lazyload" src="{{asset('assets/images/logo/'.$gs->lazy_baner)}}" data-src="{{asset('assets/images/post/'.$row->image_big)}}" alt="{{strlen($row->title)>60 ? mb_substr($row->title,0,60,"utf-8") : $row->title}}" title="{{strlen($row->title)>60 ? mb_substr($row->title,0,60,"utf-8") : $row->title}}">

                                             


                                            <h4 class="tab_hadding"><a href="{{ route('frontend.postBySubcategory.details',[$row->id,$row->slug])}}"> {{strlen($row->title)>60 ? mb_substr($row->title,0,60,"utf-8") : $row->title}} </a></h4> 



                                            <div class="conut">
                                                                                {{ $loop->iteration }}
                                                 

                                            </div>



                                        </div>

                                                                            

                                    </div><!-- tab Item End-->   

                                      @endforeach                                    
                                    

                                   
								   

                                                                                                                             

                                </div>

                            </div>

                            <div class="tab-pane fade " id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab">

                                <div class="tavs">                       

                                    
                                                                  @php
					$thirdcat=DB::table('categories')->where('parent_id',null)->skip(2)->first();
					$thirdcatpostbig=DB::table('posts')->where('category_id',$thirdcat->id)->where('is_trending',1)->orderBy('id','DESC')->limit(1)->get();
					$thirdcatpostsmall=DB::table('posts')->where('category_id',$thirdcat->id)->where('is_trending',1)->orderBy('id','DESC')->skip(1)->limit(20)->get();
					@endphp  
                                      
                                    @foreach ($thirdcatpostsmall as $row)                                

                                    <div class="tab-item"> <!-- tab Item Start-->                                  

                                        <div class="tab-image tab-border">

                                            <img class="lazyload" src="{{asset('assets/images/logo/'.$gs->lazy_baner)}}" data-src="{{asset('assets/images/post/'.$row->image_big)}}" alt="{{strlen($row->title)>60 ? mb_substr($row->title,0,60,"utf-8") : $row->title}}" title="{{strlen($row->title)>60 ? mb_substr($row->title,0,60,"utf-8") : $row->title}}">

                                             


                                            <h4 class="tab_hadding"><a href="{{ route('frontend.postBySubcategory.details',[$row->id,$row->slug])}}"> {{strlen($row->title)>60 ? mb_substr($row->title,0,60,"utf-8") : $row->title}}  </a></h4> 



                                            <div class="conut">

                                                                                {{ $loop->iteration }}
                                                 

                                            </div>



                                        </div>

                                                                            

                                    </div><!-- tab Item End-->  
                                                                         
 @endforeach 
                                   
								   
								   
                                     
                                                    

                                </div>            

                            </div>

                        

                        </div>

                        
                                
        


  



                            </div>
                             

                        </div>
						
						
                    </div>
                </div>
            </section>

        </div><!-- All Section Close -->
 
@endsection