@extends('web.layouts.layout')
@section('content')


    <main>
        <!-- Start pg_header -->
    @include('web.pages.components.header.header')


            <!-- Start section -->
        <section class="products_sec section">
            <div class="container">
                @if(count($products) > 0)
                    <div class="row">
                        @foreach($products as $row)
                            <div class="col-lg-4">
                                @include('web.pages.components.products.card',['product'=>$row])
                            </div>
                        @endforeach
                    </div>
                    <div class="row">
                        @if(!($products->hasMorePages() == false && $products->currentPage() == 1))
                            <div class="pagination-wrapper mt-4">
                                <nav aria-label="Page navigation example">
                                    <ul class="pagination justify-content-center">
                                        @if (!$products->onFirstPage())
                                            <li class="page-item">
                                                <a class="page-link" href="{{$products->previousPageUrl().'&'.$params}}" aria-label="Previous">
                                                    <span aria-hidden="true">«</span>
                                                </a>
                                            </li>
                                        @endif
                                        @foreach ($products->getUrlRange(1, $products->lastPage()) as $page => $url)
                                            <li class="page-item"><a class="page-link {{$products->currentPage() == $page ? 'active' : '' }}" href="{{$url.'&'.$params}}">{{$page}}</a></li>
                                        @endforeach
                                        @if ($products->hasMorePages())
                                            <li class="page-item">
                                                <a class="page-link" href="{{$products->nextPageUrl().'&'.$params}}" aria-label="Next">
                                                    <span aria-hidden="true">»</span>
                                                </a>
                                            </li>
                                        @endif
                                    </ul>
                                </nav>
                            </div>
                        @endif
                    </div>
                @else
                    @include('web.pages.components.not_found',['message'=>__('web.not_exist_products_search')])
                @endif

            </div>
        </section>

    </main>



@stop
