
<?php $__env->startSection('title'); ?> Role || SHOP <?php $__env->stopSection(); ?>
<?php $__env->startSection('roles'); ?> active <?php $__env->stopSection(); ?>
<?php $__env->startSection('styles'); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('main_content_section'); ?>
	
	<!-- BEGIN: Content-->
    <div class="app-content content min-vh-100">
		<div class="content-header row ps-2">
			<div class="content-header-left col-md-9 col-12">
				<div class="row breadcrumbs-top">
					<div class="col-12 my-3">
						<h3 class="content-header-title float-start mb-0">Update Permission</h3>
					</div>
				</div>
			</div>
		</div>
	    <div class="card">
			<form action="<?php echo e(route('roles.update', $role->id)); ?>" method="post">
				<?php echo csrf_field(); ?>
				<?php echo method_field('put'); ?>

				<div class="card-body border-bottom pb-4">
					<div class="form-group">
						<label class="required" for="name">Role Name <span class="text-danger">(required)</span></label>

						<?php if(($role->name == 'superadmin') || ($role->name == 'admin')): ?>
						<input class="form-control custom-readonly-color" type="text" name="name" id="name" value="<?php echo e(Str::title($role->name)); ?>" readonly placeholder="Role Name">
						<?php else: ?>
						<input class="form-control" type="text" name="name" id="name" value="<?php echo e(Str::title($role->name)); ?>" placeholder="Role Name" required>
						<?php endif; ?>

						<?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
						<span class=text-danger><?php echo e($message); ?></span>
						<?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
					</div>
				</div>

	        	<div class="card-body">
					<div class="container">
						<div class="row">
							<?php $i = 0; ?>
							<?php $__currentLoopData = $permissionGroups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $group): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
							<?php if(isset($group) && $group != null): ?>
							<?php
							$permissions = App\Models\User::getpermissionsByGroupName($group->name);
							$j = 1;
							$i += 1
							?>
				
							<div class="col-md-4 mb-3">
								<div class="input-field">
									<p>
										<label class="custom-permission-group-color">
											<input type="checkbox" id="<?php echo e($i); ?>Management" value="<?php echo e($group->name); ?>"
												onclick="checkPermissionByGroup('role-<?php echo e($i); ?>-management-checkbox', this)"
												<?php echo e(App\Models\User::roleHasPermissions($role, $permissions) ? 'checked' : ''); ?>

												class="custom-permission-check-box" />
				
											<span class="custom-permission-group-name custom-cursor-pointer"
												for="<?php echo e($i); ?>Management"><?php echo e(Str::title($group->name)); ?></span>
										</label>
									</p>
								</div>
							</div>
				
							<div class="col-md-8 mb-3">
								<div class="input-field role-<?php echo e($i); ?>-management-checkbox">
				
									<?php $__currentLoopData = $permissions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $permission): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
									<?php if(isset($group) && $group != null): ?>
									<p>
										<label>
											<input class="filled-in common-input" type="checkbox" name="permissions[]"
												onclick="checkSinglePermission('role-<?php echo e($i); ?>-management-checkbox', '<?php echo e($i); ?>Management', <?php echo e(count($permissions)); ?>)"
												<?php echo e($role->hasPermissionTo($permission->name) ? 'checked' : ''); ?> id="checkPermission<?php echo e($permission->id); ?>"
												value="<?php echo e($permission->name); ?>">
									
											<span class="custom-permission-name custom-cursor-pointer" for="checkPermission<?php echo e($permission->id); ?>"><?php echo e($permission->name); ?></span>
										</label>
									</p>
									<?php endif; ?>
									<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
				
								</div>
							</div>
				
							<?php endif; ?>
							<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
						</div>
				
						<div class="row">
							<div class="col-12 col-sm-12 col-md-2 col-lg-2 col-xl-2 d-flex align-items-center"
								style="margin-top: 15px;">
								<input type="submit" name="submit" class="btn btn btn-success" value="Update">
							</div>
						</div>
					</div>
				</div>
			</form>

	    </div>

    </div>
    <!-- END: Content-->

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

<?php $__env->startSection('scripts'); ?>
<?php echo $__env->make('admin.userRole.roles.partial.script', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\Project\Personal-Project\Office-Project\Next-Web-Service\muktijoddhe-somobai-somity\resources\views/admin/userRole/roles/edit.blade.php ENDPATH**/ ?>