<?php $__env->startSection('title', 'Roles & Permissions'); ?>

<?php $__env->startSection('page-header'); ?>
<header class="header bg-ui-general">
     <div class="header-info">
          <h1 class="header-title">
               <strong>Roles & Permissions</strong>
          </h1>
     </div>

     
</header>
<?php $__env->stopSection(); ?>

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

<div class="col-12">

     <div class="card">
          <div class="card-header">
               <h4>Add Role</h4>
          </div>
          <div class="card-body">
               <form action="<?php echo e(route('roles.store')); ?>" method="POST" class="form-row">
                    <?php echo csrf_field(); ?>
                    <div class="form-group col-md-8">
                      <label for="">Role Name</label>
                      <input type="text" name="name" value="<?php echo e(old("name")); ?>" class="form-control">
                      <?php if($errors->has('name')): ?>
                        <div class="alert alert-danger"><?php echo e($errors->first('name')); ?></div>
                      <?php endif; ?>
                    </div>

                    <div class="form-group col-md-4">
                         <label for="" style="display: block;visibility: hidden">X</label>
                         <input type="submit" class="btn btn-success" value="Add Role">
                    </div>
               </form>
          </div>
     </div>

     <div class="card">
          <h4 class="card-title"><strong>Roles</strong></h4>

          <div class="card-body card-body-soft">
               <?php if($roles->count() > 0): ?>
               <div class="table-responsive-sm table-bordered">
                    <table class="table table-soft">
                         <thead>
                              <tr class="bg-primary">
                                   <th>#</th>
                                   <th>Role</th>
                                   <th>Users</th>
                                   <th>#</th>
                              </tr>
                         </thead>

                         <tbody>
                              <?php $__currentLoopData = $roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                              <tr>
                                   <td><?php echo e(++$key); ?></td>
                                   <td><?php echo e(ucfirst($item->name)); ?></td>
                                   <td><?php echo e($item->users->count()); ?></td>
                                   <td style="width:15%;">
                                        <a href="<?php echo e(route('role_permissions.edit',$item->id)); ?>" data-provide="tooltip" data-tooltip-color="brown"
                                             title="Role Permission List" class="btn btn-primary btn-xs">
                                             <i class="fa fa-list"></i>
                                        </a>
                                        <a href="<?php echo e(route('roles.edit',$item->id)); ?>" data-provide="tooltip" data-tooltip-color="info" title="Role Edit"
                                             class="btn btn-info btn-xs">
                                             <i class="fa fa-edit"></i>
                                        </a>
                                        <a href="<?php echo e(route('roles.destroy',$item->id)); ?>" data-provide="tooltip" data-tooltip-color="danger"
                                             title="Role Delete" class="btn btn-danger btn-xs delete">
                                             <i class="fa fa-trash"></i>
                                        </a>
                                   </td>
                              </tr>
                              <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                         </tbody>

                    </table>
                    <?php echo e($roles->links()); ?>

               </div>
               <?php else: ?>
               <div class="alert alert-danger" role="alert">
                    <strong>You have no roles</strong>
               </div>
               <?php endif; ?>
          </div>
     </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('styles'); ?>
<style>
     .table tr td {
          vertical-align: middle;
          padding: 5px;
          text-align: center;
          font-weight: 500;
     }

     .table tr th {
          text-align: center;
     }
</style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<?php echo $__env->make('includes.delete-alert', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/demosoftghor/sm.demo.softghor.com/resources/views/pages/roles/index.blade.php ENDPATH**/ ?>