@extends('layouts.master')


@section('title', 'Users')

@include('layouts.nav')

@section('content')


    <table class="table">
        <thead>
            <tr>
                <th>Username</th>
                <th>Nombre</th>
                <th>Teléfono</th>
                <th>Cuenta</th>
                <th></th>
            </tr>
        </thead>
        <tbody>
        @foreach($users as $user)
            <tr>
                <td>{{$user->email}}</td>
                <td>{{$user->name}}</td>
                <td>{{$user->number}}</td>
                @if($user->enabled == 1)
                    <td><span class="bg-success">Habilitada</span></td>
                @else
                    <td><span class="bg-danger">Bloqueada</span></td>
                @endif

                <td>
                    <a href="{{ route('user.show', [$user->id]) }}" class="btn btn-primary">Ver más</a>
                </td>
            </tr>
        @endforeach
        </tbody>
    </table>



    <div>
        <p><b>Mostrando usuarios {{$users->firstItem()}}-{{$users->lastItem()}} de {{$users->total()}}</b></p>
    </div>


    {{ $users->links() }}

@endsection