<?php $user = app('App\Http\Controllers\UsersController'); ?>



<?php $__env->startSection('title'); ?>
Invite Keys
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="container">
    <?php if(session()->has('message')): ?>
        <div class="alert alert-success">
            <?php echo e(session()->get('message')); ?>

        </div>
    <?php endif; ?>
    <h1><b>Invite Keys</b></h1>
    <p>All invite keys, depleted or not. Disabling a key turns its uses to zero, it doesn't delete it for archival purposes.</p>
    <?php if($invitekeys->count() > 0): ?>
    <table class="table">
        <thead>
            <tr>
                <th scope="col">ID</th>
                <th scope="col">Creator</th>
                <th scope="col">Key</th>
                <th scope="col">Uses Remaining</th>
                <th scope="col">Created</th>
                <th scope="col">Updated</th>
                <th scope="col">Disable</th>
            </tr>
        </thead>
        <tbody>
            <?php $__currentLoopData = $invitekeys; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $invitekey): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <th scope="row"><?php echo e($invitekey->id); ?></th>
                    <td><a href="/users/<?php echo e($invitekey->user->id); ?>/profile"><?php echo e($invitekey->user->username); ?></a></td>
                    <td><code><?php echo e($invitekey->token); ?></code></td>
                    <td><?php echo e($invitekey->uses); ?></td>
                    <td><?php echo e(date('m/d/Y ', strtotime($invitekey->created_at))); ?></td>
                    <td><?php echo e(date('m/d/Y ', strtotime($invitekey->updated_at))); ?></td>
                    <td>
                        <form method="POST" action="<?php echo e(route('admin.disableinvitekey', $invitekey->id)); ?>">
                            <?php echo csrf_field(); ?>

                            <button class="btn btn-danger btn-sm"><i class="fas fa-times"></i></button>
                        </form>
                    </td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody>
    </table>
    <div class="d-flex justify-content-center">
        <?php echo e($invitekeys->links('pagination::bootstrap-4')); ?>

    </div>
    <?php else: ?>
    <hr>
    <h1>No invite keys</h1>
    <p>Well, you obviously can't invite anyone without any invite keys, so <a href="/admin/createinvitekey">go make some.</a></p>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\project\tadah\tadah\resources\views/admin/invitekeys.blade.php ENDPATH**/ ?>