
@if ($data->hasPages())

    <div class="ui right floated pagination menu">
        @if($data->previousPageUrl())
            <a href="{{ $data->url(1) }}" class="icon item" title="Primero"><i class="angle double left icon"></i></a>
            <a href="{{ $data->previousPageUrl() }}" class="icon item" title="Anterior"><i class="chevron left icon"></i></a>
        @endif
        @foreach(range(1, $data->lastPage()) as $i)
            @if($i >= $data->currentPage() - 3 && $i <= $data->currentPage() + 3)
                @if ($i == $data->currentPage())
                    <a class="disabled item">{{$i}}</a>
                @else
                    <a href="{{$data->url($i)}}" class="item">{{$i}}</a>
                @endif
            @endif
        @endforeach
        @if($data->hasMorePages())
            <a href="{{ $data->nextPageUrl() }}" class="icon item" title="Siguiente"><i class="chevron right icon"></i></a>
            <a href="{{ $data->url($data->lastPage()) }}" class="icon item" title="Último"><i class="angle double right icon"></i></a>
        @endif
    </div>

 @endif