

<?php $__env->startSection('content'); ?>
<div class="container-xxl flex-grow-1 container-p-y">
    <div class="card">
        <div class="card-header">

            <!-- Navigation Buttons -->
            <!-- Navigation Buttons -->
            <div class="row align-items-center">
                <div class="col-12 mt-3">

                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('view role')): ?>
                        <a href="<?php echo e(url('roles')); ?>" class="btn btn-primary mx-1">Roles</a>
                    <?php endif; ?>

                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('view permission')): ?>
                        <a href="<?php echo e(url('permissions')); ?>" class="btn btn-info mx-1">Permissions</a>
                    <?php endif; ?>

                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('view user')): ?>
                        <a href="<?php echo e(url('users')); ?>" class="btn btn-warning mx-1">Users</a>
                    <?php endif; ?>

                </div>
            </div>

            <hr>
        </div>

        <div class="container mt-2">
            <div class="row">
                <div class="col-md-12">

                    <!-- Success Message -->
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(session('status')): ?>
                        <div class="alert alert-success"><?php echo e(session('status')); ?></div>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

                    <!-- Permissions Card -->
                    <div class="card mt-3">
                        <div class="card-header d-flex justify-content-between align-items-center">
                            <h4 class="mb-0">Permissions</h4>
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('create permission')): ?>
                                <a href="<?php echo e(url('permissions/create')); ?>" class="btn btn-primary">Add Permission</a>
                            <?php endif; ?>
                        </div>

                        <div class="card-body">
                            <div class="table-responsive">
                                <table id="bookings-table" class="table table-bordered table-striped align-middle text-center">
                                    <thead class="table-light">
                                        <tr>
                                            <th>Id</th>
                                            <th>Name</th>
                                            <th>Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $permissions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $permission): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr>
                                            <td><?php echo e($permission->id); ?></td>
                                            <td><?php echo e($permission->name); ?></td>
                                            <td>
                                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('update permission')): ?>
                                                    <a href="<?php echo e(url('permissions/'.$permission->id.'/edit')); ?>" class="btn btn-success btn-sm">Edit</a>
                                                <?php endif; ?>

                                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('delete permission')): ?>
                                                    <a href="<?php echo e(url('permissions/'.$permission->id.'/delete')); ?>" class="btn btn-danger btn-sm ">Delete</a>
                                                <?php endif; ?>
                                            </td>
                                        </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                    </tbody>
                                </table>
                            </div> <!-- .table-responsive -->
                        </div>
                    </div> <!-- .card -->
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startPush('script'); ?>
<script>
$(document).ready(function () {
    $('#bookings-table').DataTable({
        responsive: true,
        scrollX: true,
        // pageLength: 10,
        // lengthMenu: [5, 10, 25, 50, 100],
        // order: [[0, 'asc']],
        // columnDefs: [
        //     { orderable: false, targets: -1 } // disable sorting for last column
        // ]
    });
});
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH F:\xampp\htdocs\role_permission\resources\views/role-permission/permission/index.blade.php ENDPATH**/ ?>