<?php $__env->startSection('title', 'Edit Permissions'); ?>
<?php $__env->startSection('page-title', 'Permissions: ' . $user->name); ?>
<?php $__env->startSection('content'); ?>
    <form method="POST" action="<?php echo e(route('admin.permissions.update', $user)); ?>"
        class="mx-auto max-w-4xl rounded-2xl border border-slate-200 bg-white p-6 shadow-soft dark:border-slate-800 dark:bg-slate-900">
        <?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?>
        <div class="mb-6 rounded-xl bg-slate-50 p-4 dark:bg-slate-800/60">
            <div class="font-semibold text-slate-900 dark:text-white"><?php echo e($user->name); ?></div>
            <div class="text-sm text-slate-500"><?php echo e($user->email); ?> · <?php echo e(str($user->role)->replace('_', ' ')->title()); ?>

            </div>
        </div>
        <?php if($user->role === 'super_admin'): ?>
            <div class="mb-6 rounded-xl border border-amber-200 bg-amber-50 p-4 text-sm text-amber-800">Super administrators
        always have full module access.</div><?php endif; ?>
        <div class="grid gap-3 md:grid-cols-2">
            <?php $__currentLoopData = $modules; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $module): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <label
                    class="flex cursor-pointer items-start gap-3 rounded-xl border border-slate-200 p-4 hover:border-emerald-300 dark:border-slate-700">
                    <input type="checkbox" name="permissions[]" value="<?php echo e($key); ?>" class="mt-1 h-4 w-4 rounded" <?php echo e(($user->module_permissions === null || in_array($key, $user->module_permissions, true)) ? 'checked' : ''); ?> <?php echo e($user->role === 'super_admin' ? 'disabled' : ''); ?>>
                    <span><span
                            class="block text-sm font-semibold text-slate-900 dark:text-white"><?php echo e($module['label']); ?></span><span
                            class="mt-1 block text-xs text-slate-500"><?php echo e($module['description']); ?></span></span>
                </label>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>
        <div class="mt-8 flex justify-end gap-3 border-t border-slate-200 pt-6 dark:border-slate-800"><a
                href="<?php echo e(route('admin.permissions.index')); ?>" class="btn-danger"><i class="fa-solid fa-xmark"></i>
                Cancel</a><button class="btn-primary" type="submit" <?php echo e($user->role === 'super_admin' ? 'disabled' : ''); ?>><i
                    class="fas fa-plus"></i> Save Permissions</button></div>
    </form>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/mac/Documents/e-com/resources/views/admin/permissions/edit.blade.php ENDPATH**/ ?>