<?php $__env->startSection('title', 'Edit Role'); ?>
<?php $__env->startSection('content'); ?>


    <div class="row">
        <div class="widget">
            <div class="widget-header"> <i class="icon-edit"></i>
                <h3>Edit Role : <?php echo e($roles->name); ?></h3>
            </div>
            <!-- /widget-header -->
            <div class="widget-content">
                <form method="POST" action="<?php echo e(route('roles.update',$roles->id)); ?>" accept-charset="UTF-8" class="form-horizontal">
                    <fieldset>
                        <?php echo csrf_field(); ?>
                        <?php echo method_field('PUT'); ?>
                        <div class="control-group">
                            <label class="control-label asterisk" for="firstname">Name:</label>
                            <div class="controls">
                                <input class="span3" name="name" type="text" id="name" value="<?php echo e($roles->name); ?>" placeholder="App Name
"><?php if($errors->has('name')): ?>
                                    <span class="text-danger"><?php echo e($errors->first('name')); ?></span>
                                <?php endif; ?>
                            </div> <!-- /controls -->
                        </div> <!-- /control-group -->

                        <div class="control-group">
                            <label class="control-label" for="firstname">Color:</label>
                            <div class="controls">
                                <input id="simple-color-picker" type="text" name="color" class="span3" value="<?php echo e($roles->color); ?>"/>
                            </div> <!-- /controls -->
                        </div> <!-- /control-group -->
                        
                        <div class="control-group">
                            <label class="control-label" for="firstname">Permission:</label>
                            <div class="controls">
                                <select name="permission_ids[]" class="span3" multiple="multiple">
                                    <?php $__currentLoopData = $permissionlists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($cat); ?>" <?php if(str_contains($roles->permission_ids, $cat)): ?> selected <?php endif; ?>> <?php echo e($value); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div> <!-- /controls -->
                        </div> <!-- /control-group -->
                        
                        <div class="control-group">
                            <div class="controls">

                                <?php if($roles->default_set == 1): ?>
                                    <input type="hidden" name="default_set" value="1">
                                <?php else: ?>
                                    <input type="hidden" name="default_set" value="0">
                                <?php endif; ?>

                                <input type="checkbox" <?php if($roles->default_set == 1): ?> checked disabled <?php endif; ?> name="default_set" value="1" id="ischeck"> Default Role</label>

                            </div> <!-- /controls -->
                        </div> <!-- /control-group -->

                        <br />


                        <div class="form-actions">
                            <input class="btn btn-primary" type="submit" value="Update">
                            <a href="<?php echo e(url('roles')); ?>" class="btn btn-default">Back</a>
                        </div> <!-- /form-actions -->
                    </fieldset>
                </form>
                <!-- /shortcuts -->
            </div>
            <!-- /widget-content -->
        </div>
        <!-- /widget -->
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>