<?php 
    $cart = Session::get('cart');
?>
<div class="row col-md-12">
@foreach($data as $item)
@php $status = 0; @endphp
    <div class="col-lg-2 col-md-4 col-sm-6 col-xs-3 col-6 bg pos-item p-5">
        <div class="thumbnail">

            {{-- <div class="caption" style="background-size: cover;background-image: url('/assets/images/resize/768x768/{{$item->feature}}');"> --}}
            <div class="caption">
                <center><h4 class="text-danger"><b>{{ $item->item_house }}</b></h4>
                <p class="text-blue"><b>{{ $item->item_price }}$</b></p>
                <p class="text-blue inven-name"><b>Stock : {{ $item->inv_name }}</b></p></center>
                @if($item->block_status==2)
                    <p class="btn-holder"><span data-id="{{$item->id}}" class="btn btn-default btn-block text-center txt-danger fa fa-times" role="button"> Not Available</span> </p>
                    <p class="btn-holder"><span data-id="{{$item->id}}" class="btn btn-block btn-default text-center txt-warning" role="button" data-toggle="tooltip" data-placement="top" title="Blocked By :{{$item->user}}"> BLOCKED</span> </p>
                @else
                    @if(!$cart)
                    <p class="btn-holder"><span data-id="{{$item->id}}" class="btn btn-default btn-block text-center btn-add-to-cart" role="button">Add To Cart</span> </p>
                    @else
                        @foreach($cart as $key => $item_cart)

                            @if($item_cart['item_id']==$item->id)
                                <p class="btn-holder"><span data-id = "{{$item->id}}" class="btn btn-danger btn-block text-center" role="button">Added To Cart</span> </p>
                                <?php $status = 1 ?>
                            @endif
                        @endforeach
                        @if($status != 1)
                        <p class="btn-holder"><span data-id="{{$item->id}}" class="btn btn-default btn-block text-center btn-add-to-cart" role="button">Add To Cart</span> </p>
                        @endif
                    @endif
                    @if(Auth::user()->block_permission==1)
                        <p class="btn-holder"><span data-id="{{$item->id}}"  data-hour="{{$item->item_block_time}}" class="btn btn-block btn-default text-center btn-block-item" role="button">Block Item</span> </p>
                    @endif
                @endif
            </div>
        </div>
    </div>
@endforeach
</div>
{!! $data->render() !!}
<style>
    .thumbnail {
        display: block;
        padding: 0px !important;
        margin-bottom: 15px !important;
        line-height: 1.42857143;
        background-color: #fff;
        border: 1px solid #ddd;
        border-radius: 4px;
        -webkit-transition: border .2s ease-in-out;
        -o-transition: border .2s ease-in-out;
        transition: border .2s ease-in-out;
    }
    .h4, .h5, .h6, h4, h5, h6 {
        margin-top: 0px !important;
        margin-bottom: 0px !important;
    }
</style>