<?php $__env->startSection('content'); ?>

<h1 class="text-success">user index with view </h1>
<table class="table">
    <thead>
      <tr>
        <th scope="col">#</th>
        <th scope="col">name</th>
        <th scope="col">email</th>
        <th scope="col">rolse</th>
        <th scope="col">control</th>
      </tr>
    </thead>
    <tbody>
        <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <tr>
        <th scope="row"><?php echo e($item->id); ?></th>
            <td><?php echo e($item->name); ?></td>
            <td><?php echo e($item->email); ?></td>
            <td><?php echo e(implode(' - ',$item->roles()->get()->pluck('name')->toArray())); ?></td>
            <td>
              <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('edit-user')): ?>  
              <a href="<?php echo e(route('admin.user.edit', $item->id)); ?>"><button type="button" class="btn btn-info">Edit</button></a>
              <?php endif; ?> 
              <a href="<?php echo e(route('admin.user.edit', $item->id)); ?>"><button type="button" class="btn btn-warning">Delete</button></a>
            </td>
          </tr>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </tbody>
  </table>


<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /opt/lampp/apps/blog/resources/views/admin/user/index.blade.php ENDPATH**/ ?>