
<?php $__env->startSection('meta-content'); ?>
 <?php
    $settings = \App\Models\GeneralSetting::find(1);
    ?>
<title><?php if($settings): ?><?php echo e($settings->site_title); ?><?php endif; ?></title>
<meta name="description" content="<?php if($settings): ?><?php echo e($settings->meta_description); ?><?php endif; ?>">
<meta name="title" content="<?php if($settings): ?><?php echo e($settings->meta_title); ?><?php endif; ?>">
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
  <!-- Featured Post Area Start --> 
  <section class="utf_featured_post_area pt-4 no-padding">
    <div class="container">
      <div class="row">
        <div class="col-lg-7 col-md-12 pad-r">
          <div id="utf_featured_slider" class="owl-carousel owl-theme utf_featured_slider">
            <?php
                $popularblog = $popularblogs->shift();
            ?>
            <?php if($popularblog): ?>
            <div class="item" style="background-image:url(<?php echo e(asset('admin-assets/images/blogs')); ?>/<?php echo e($popularblog->feature_image); ?>)">
              <div class="utf_featured_post">
                <div class="utf_post_content"> <a class="utf_post_cat" href="#"><?php echo e($popularblog->category->name); ?></a>
                  <h2 class="utf_post_title title-extra-large"> <a href="<?php echo e(route('blog.details',$popularblog->slug)); ?>"><?php echo e($popularblog->title); ?></a> </h2>
                  <span class="utf_post_author"><i class="fa fa-user"></i> <a href="#">Admin</a></span>	
				  <span class="utf_post_date"><i class="fa fa-clock-o"></i><?php echo e($popularblog->updated_at->toFormattedDateString()); ?></span> 
				</div>
              </div>              
            </div>
            <?php endif; ?>
          </div>
        </div>
        
        <div class="col-lg-5 col-md-12 pad-l">
          <div class="row">
            <?php
                $second_single_blog = $popularblogs->shift();
            ?>
            <div class="col-md-12">
                <div class="utf_post_overaly_style contentTop hot-post-top clearfix">
                  <div class="utf_post_thumb"> <a href="#"><img class="img-fluid" src="<?php echo e(asset('admin-assets/images/blogs')); ?>/<?php echo e($second_single_blog->feature_image); ?>" alt="" /></a> </div>
                  <div class="utf_post_content"> <a class="utf_post_cat" href="#"><?php echo e($second_single_blog->category->name); ?></a>
                    <h2 class="utf_post_title title-medium"> <a href="<?php echo e(route('blog.details',$second_single_blog->slug)); ?>"><?php echo e($second_single_blog->title); ?></a> </h2>
                    <div class="utf_post_meta"> <span class="utf_post_author"><i class="fa fa-user"></i> <a href="#">Admin</a></span></div>
                  </div>
                </div>
              </div>
            <?php $__currentLoopData = $popularblogs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="col-md-6 <?php echo e($key % 2 == 0 ? 'pad-r-small' : 'pad-l-small'); ?>">
              <div class="utf_post_overaly_style contentTop utf_hot_post_bottom clearfix">
                <div class="utf_post_thumb"> <a href="#"><img class="img-fluid" src="<?php echo e(asset('admin-assets/images/blogs')); ?>/<?php echo e($row->feature_image); ?>" alt="" /></a> </div>
                <div class="utf_post_content"> <a class="utf_post_cat" href="#"><?php echo e($row->category->name); ?></a>
                  <h2 class="utf_post_title title-medium"> <a href="<?php echo e(route('blog.details',$row->slug)); ?>"><?php echo e($row->title); ?></a> </h2>
				  <div class="utf_post_meta"> <span class="utf_post_author"><i class="fa fa-user"></i> <a href="#">Admin</a></span></div>
                </div>
              </div>
            </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
          </div>
        </div>        
      </div>
    </div>
  </section>
  <!-- Featured Post Area End --> 
  
  <!-- Latest News Area Start --> 
  <section class="utf_latest_new_area pb-bottom-20">
   <div class="container">
	<div class="utf_latest_news block color-red">
	  <h3 class="utf_block_title"><span>Latest News</span></h3>
		<div id="utf_latest_news_slide" class="owl-carousel owl-theme utf_latest_news_slide">
        <?php $__currentLoopData = $blogs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
		  <div class="item">
			<ul class="utf_list_post">
			  <li class="clearfix">
				<div class="utf_post_block_style clearfix">
				  <div class="utf_post_thumb"> <a href="#"><img class="img-fluid" src="<?php echo e(asset('admin-assets/images/blogs')); ?>/<?php echo e($row->feature_image); ?>" alt="" /></a> </div>
				  <a class="utf_post_cat" href="#"><?php echo e($row->category->name); ?></a>
				  <div class="utf_post_content">
					<h2 class="utf_post_title title-medium"> <a href="#"><?php echo e(\Illuminate\Support\Str::limit($row->title, 50)); ?></a> </h2>
					<div class="utf_post_meta"> <span class="utf_post_author"><i class="fa fa-user"></i> <a href="#">Admin</a></span> <span class="utf_post_date"><i class="fa fa-clock-o"></i> <?php echo e($row->updated_at->toFormattedDateString()); ?></span> </div>
				  </div>
				</div>
			  </li>
			</ul>			
		  </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
		</div>
	  </div>
	</div>		
  </section>
  <!-- Latest News Area End -->
  
  <!-- Ad Content Area Start -->
  <div class="utf_ad_content_area text-center utf_banner_area no-padding">
    <div class="container">
      <div class="row">
        <div class="col-md-12"> <img class="img-fluid" src="<?php echo e(asset('user-assets/images/ad-content-one.jpg')); ?>" alt="" /> </div>
      </div>
    </div>
  </div>
  <!-- Ad Content Area End -->
  
  
  <!-- 2rd Block Wrapper Start -->
  <section class="utf_block_wrapper p-bottom-0">
    <div class="container">
      <div class="row">
        <?php $__currentLoopData = $category_blogs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <?php
            $categblogs = \App\Models\Blog::where('category_id', $category->id)->where('status', 'publish')->latest()->inRandomOrder()->limit(4)->get();
        ?>
        <div class="col-lg-4">
          <div class="block color-dark-blue">
            <h3 class="utf_block_title"><span><?php echo e($category->name); ?></span></h3>
            <?php
                $chblog = $categblogs->shift();
            ?>
            <?php if($chblog): ?>
            <div class="utf_post_overaly_style clearfix">
              <div class="utf_post_thumb"> <a href="<?php echo e(route('blog.details', $chblog->slug)); ?>"> <img class="img-fluid" src="<?php echo e(asset('admin-assets/images/blogs')); ?>/<?php echo e($chblog->feature_image); ?>" alt="" /> </a> </div>
              <div class="utf_post_content">
                <h2 class="utf_post_title"> <a href="<?php echo e(route('blog.details', $chblog->slug)); ?>"><?php echo e($chblog->title); ?></a> </h2>
                <div class="utf_post_meta"> <span class="utf_post_author"><i class="fa fa-user"></i> <a href="#">Admin</a></span> <span class="utf_post_date"><i class="fa fa-clock-o"></i> <?php echo e($chblog->created_at->format('d M, Y')); ?></span> </div>
              </div>
            </div>
            <?php endif; ?>
            
            <div class="utf_list_post_block">
              <ul class="utf_list_post">
                <?php $__currentLoopData = $categblogs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cblog): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <li class="clearfix">
                  <div class="utf_post_block_style post-float clearfix">
                    <div class="utf_post_thumb"> <a href="<?php echo e(route('blog.details', $cblog->slug)); ?>"> <img class="img-fluid" src="<?php echo e(asset('admin-assets/images/blogs')); ?>/<?php echo e($cblog->feature_image); ?>" alt="" /> </a> </div>
                    <div class="utf_post_content">
                      <h2 class="utf_post_title title-small"> <a href="<?php echo e(route('blog.details', $cblog->slug)); ?>"><?php echo e($cblog->title); ?></a> </h2>
                      <div class="utf_post_meta"> <span class="utf_post_author"><i class="fa fa-user"></i> <a href="#">Admin</a></span> <span class="utf_post_date"><i class="fa fa-clock-o"></i> <?php echo e($cblog->created_at->format('d M, Y')); ?></span> </div>
                    </div>
                  </div>
                </li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
              </ul>
            </div>
            
          </div>
        </div>  
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> 
        <div class="col-lg-4">
            <div class="widget color-default">
                <h3 class="utf_block_title"><span>Popular News</span></h3>
                <?php
                    $topblog = $topblogs->shift();
                ?>
                <div class="utf_post_overaly_style clearfix">
                  <div class="utf_post_thumb"> <a href="#"> <img class="img-fluid" src="<?php echo e(asset('admin-assets/images/blogs')); ?>/<?php echo e($topblog->feature_image); ?>" alt="" /> </a> </div>
                  <div class="utf_post_content"> <a class="utf_post_cat" href="<?php echo e(route('blog.details', $topblog->slug)); ?>"><?php echo e($topblog->category->name); ?></a>
                    <h2 class="utf_post_title"> <a href="<?php echo e(route('blog.details', $topblog->slug)); ?>"><?php echo e($topblog->title); ?></a> </h2>
                    <div class="utf_post_meta"> <span class="utf_post_author"><i class="fa fa-user"></i> <a href="#">Admin</a></span> <span class="utf_post_date"><i class="fa fa-clock-o"></i> <?php echo e($topblog->created_at->format('d M, Y')); ?></span> </div>
                  </div>
                </div>
                
                <div class="utf_list_post_block">
                  <ul class="utf_list_post">
                    <?php $__currentLoopData = $topblogs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li class="clearfix">
                      <div class="utf_post_block_style post-float clearfix">
                        <div class="utf_post_thumb"> <a href="#"> <img class="img-fluid" src="<?php echo e(asset('admin-assets/images/blogs')); ?>/<?php echo e($row->feature_image); ?>" alt="" /> </a> <a class="utf_post_cat" href="<?php echo e(route('blog.details', $row->slug)); ?>"><?php echo e($row->category->name); ?></a> </div>
                        <div class="utf_post_content">
                          <h2 class="utf_post_title title-small"> <a href="<?php echo e(route('blog.details', $row->slug)); ?>"><?php echo e($row->title); ?></a> </h2>
                          <div class="utf_post_meta"> <span class="utf_post_author"><i class="fa fa-user"></i> <a href="#">Admin</a></span> <span class="utf_post_date"><i class="fa fa-clock-o"></i> <?php echo e($row->created_at->format('d M, Y')); ?></span> </div>
                        </div>
                      </div>
                    </li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </ul>
                </div>
              </div>
        </div>    
      </div>
    </div>
  </section>
  <!-- 2rd Block Wrapper End -->
  
  <!-- 3rd Block Wrapper Start -->
  <section class="utf_block_wrapper p-bottom-0">
    <div class="container">
      <div class="row">
            <div class="col-lg-8 col-md-12">
                <div class="utf_more_news block color-default">
                    <h3 class="utf_block_title"><span>View More News</span></h3>
                    <div id="utf_more_news_slide" class="owl-carousel owl-theme utf_more_news_slide">
                    
                        <div class="item">
                            <?php $__currentLoopData = $popblogs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $row): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="utf_post_block_style utf_post_float_half clearfix">
                                <div class="utf_post_thumb"> 
                                    <a href="<?php echo e(route('blog.details', $row->slug)); ?>"> 
                                        <img class="img-fluid" src="<?php echo e(asset('admin-assets/images/blogs')); ?>/<?php echo e($row->feature_image); ?>" alt="" /> 
                                    </a> 
                                </div>
                                <a class="utf_post_cat" href="#"><?php echo e($row->category->name); ?></a>
                                <div class="utf_post_content">
                                    <h2 class="utf_post_title"> 
                                        <a href="<?php echo e(route('blog.details', $row->slug)); ?>"><?php echo e($row->title); ?></a> 
                                    </h2>
                                    <div class="utf_post_meta"> 
                                        <span class="utf_post_author">
                                            <i class="fa fa-user"></i> 
                                            <a href="#">Admin</a>
                                        </span> 
                                        <span class="utf_post_date">
                                            <i class="fa fa-clock-o"></i> <?php echo e($row->created_at->format('d M, Y')); ?>

                                        </span> 
                                    </div>
                                </div>
                            </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>	
                    
                    </div>
                </div>
            </div>
            <div class="col-lg-4 col-md-12">
                <div class="sidebar utf_sidebar_right">
                    <div class="widget m-bottom-0">
                            <h3 class="utf_block_title"><span>Newsletter</span></h3>
                            <div class="utf_newsletter_block">
                                <div class="utf_newsletter_introtext">
                                    <h4>Subscribe Newsletter!</h4>
                                    <p>Lorem ipsum dolor sit consectetur adipiscing elit Maecenas in pulvinar neque Nulla finibus lobortis pulvinar.</p>
                                </div>
                                <div class="utf_newsletter_form">
                                    <form action="#" method="post">
                                    <div class="form-group">
                                        <input type="email" name="email" id="utf_newsletter_form-email" class="form-control form-control-lg" placeholder="E-Mail Address" autocomplete="off">
                                        <button class="btn btn-primary">Subscribe</button>
                                    </div>
                                    </form>
                                </div>
                            </div>
                    </div> 
                </div>  
                    
            </div>
      </div>
    </div> 
  </section>  
  <!-- 3rd Block Wrapper End -->
  
  <!-- Ad Content Area Start -->
  <div class="utf_ad_content_area text-center utf_banner_area">
    <div class="container">
      <div class="row">
        <div class="col-md-12"> <img class="img-fluid" src="<?php echo e(asset('user-assets/images/ad-content-two.png')); ?>" alt="" /> </div>
      </div>
    </div>
  </div>
  <!-- Ad Content Area End -->
 
<?php $__env->stopSection(); ?>
<?php $__env->startSection('custom-scripts'); ?>
    <script src="https://cdn.jsdelivr.net/npm/izitoast/dist/js/iziToast.min.js"></script>

    <script>

        $("#subscribe_form_btn").click(function(e) {
            e.preventDefault();
            let form = $('#subscribe_form')[0];
            let data = new FormData(form);

            $.ajax({
                url: "<?php echo e(route('subscriber.store')); ?>",
                type: "POST",
                data: data,
                dataType: "JSON",
                processData: false,
                contentType: false,

                success: function(response) {

                    if (response.errors) {
                        var errorMsg = '';
                        $.each(response.errors, function(field, errors) {
                            $.each(errors, function(index, error) {
                                errorMsg += error + '<br>';
                            });
                        });
                        iziToast.error({
                            message: 'Subscription Failed',
                            position: 'topRight'
                        });

                    } else {
                        iziToast.success({
                            message: response.success,
                            position: 'topRight'

                        });

                        $("#subscribe_form").load(location.href + " #subscribe_form");

                    }

                },
                error: function(xhr, status, error) {

                    iziToast.error({
                        message: 'An error occurred: ' + error,
                        position: 'topRight'
                    });
                }

            });

        });
       
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('user.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH F:\Laravel\realtimebrief\resources\views/user/pages/index.blade.php ENDPATH**/ ?>