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


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


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

            </div>
        </section>



    </main>


@stop
