<?php $__env->startSection('title', 'List of Roles'); ?>
<?php $__env->startSection('content'); ?>
<div class="container">
    <div class="d-flex justify-content-end mb-1">
     <a href="<?php echo e(route('roles.create')); ?>" class="btn btn-primary">Add Role</a>
    </div>
    <div class="card-header bg-primary text-white py-3 mb-4">
       <h5 class="mb-0"><i class="fas fa-users-cog me-2"></i> Roles</h5>
    </div>

    <?php if(session('success')): ?>
        <div class="alert alert-success"><?php echo e(session('success')); ?></div>
    <?php endif; ?>

    <table class="table table-bordered">
       <thead style="background-color: #0b7c85;" class="text-white">
            <tr>
                
                <th>Name</th>
                <th>Description</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
            <?php $__currentLoopData = $roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    
                    <td><?php echo e($role->name); ?></td>
                    <td>
                        <?php echo e($role->description); ?>

                    </td>
                    <td>
                        <a href="<?php echo e(route('roles.edit', $role->id)); ?>" class="btn btn-sm btn-secondary">Edit</a>
                        <form action="<?php echo e(route('roles.destroy', $role->id)); ?>" method="POST" style="display:inline-block;">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('DELETE'); ?>
                            <button type="submit" class="btn btn-sm btn-danger"
                                onclick="return confirm('Are you sure you want to delete this role?')">
                                Delete
                            </button>
                        </form>
                    </td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody>
    </table>
</div>
<?php $__env->stopSection(); ?>

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