<?php 
    $cart = Session::get('cart_edit');
?>
<div class="row col-sm-12">
@foreach($data as $item)
@php $status = 0; @endphp
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12 bg pos-item p-5">
    <div class="thumbnail">
        <div class="caption" style="background-size: cover;background-image: url('/assets/images/resize/768x768/{{$item->feature}}');">
            <center><h4 class="text-danger"><b>{{ $item->item_house }}</b></h4>
                <p class="text-blue"><b>{{ $item->item_price }}$</b></p></center>
            @if($item->block_status==2)
            <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
            @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>