 <?php $__env->startSection('title','Security & Roles'); ?> <?php $__env->startSection('content'); ?><div class="space-y-6"><h1 class="text-2xl font-black">Roles, Permissions & Attendance IP Rules</h1><div class="grid gap-6 lg:grid-cols-2"><div class="space-y-3"><?php $__currentLoopData = $roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><form class="card p-4" method="POST" action="<?php echo e(route('security.role.sync',$role)); ?>"><?php echo csrf_field(); ?> <?php echo method_field('PATCH'); ?><h2 class="font-bold"><?php echo e($role->name); ?></h2><div class="mt-3 grid grid-cols-2 gap-2"><?php $__currentLoopData = $permissions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><label class="text-xs"><input type="checkbox" name="permissions[]" value="<?php echo e($p->id); ?>" <?php if($role->permissions->contains($p)): echo 'checked'; endif; ?>> <?php echo e($p->slug); ?></label><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></div><button class="btn btn-soft mt-3">Save permissions</button></form><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></div><div><form class="card p-4" method="POST" action="<?php echo e(route('security.ip.store')); ?>"><?php echo csrf_field(); ?><h2 class="font-bold">Add approved office network</h2><select class="input mt-3 w-full" name="office_id"><?php $__currentLoopData = $offices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $o): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><option value="<?php echo e($o->id); ?>"><?php echo e($o->name); ?></option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></select><input class="input mt-3 w-full" name="label" placeholder="Main office public IP" required><input class="input mt-3 w-full" name="cidr" placeholder="203.0.113.10 or 203.0.113.0/24" required><button class="btn btn-primary mt-3">Add rule</button></form><?php $__currentLoopData = $offices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $o): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><div class="card mt-3 p-4"><h3 class="font-bold"><?php echo e($o->name); ?></h3><?php $__currentLoopData = $o->ipRules; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $x): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><div class="mt-2 flex justify-between text-sm"><span><?php echo e($x->label); ?> — <code><?php echo e($x->cidr); ?></code></span><form method="POST" action="<?php echo e(route('security.ip.delete',$x)); ?>"><?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?><button class="text-red-600">Remove</button></form></div><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></div><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></div></div></div><?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/macbook/Desktop/crm/softsuite-cms/resources/views/admin/security.blade.php ENDPATH**/ ?>