

<?php $__env->startSection('content'); ?>
<div class="header bg-gradient-primary pb-8 pt-5 pt-md-8"></div>

<div class="container-fluid mt--7">
    <?php if($errors->any()): ?>
    <div class="alert alert-danger">
        <ul>
        <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <li><?php echo e($error); ?></li>
         <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </ul>
    </div>
    <br /> 
    <?php endif; ?>

    <?php if(auth()->user()->hasRole('admin')): ?>
        <div class="row">
            <div class="col">
                <div class="card bg-secondary shadow">
                    <div class="card-header border-0">
                        <div class="row align-items-center">
                            <div class="col-12">
                                <h2 class="mb-0">Update a User - <?php echo e($user->name); ?></h2>
                                <p class="text-sm mb-0"></p>
                            </div>
                        </div>
                    </div>
                    <div class="card-body">
                        <form method="post" action="<?php echo e(route('user.update', $user->id)); ?>" enctype="multipart/form-data">
                            <?php echo method_field('PATCH'); ?> 
                            <?php echo csrf_field(); ?>
                            <div class="form-group">
                                <label class="form-control-label" for="name">Name</label>
                                <input type="text" name="name" class="form-control form-control-alternative" id="name" value="<?php echo e($user->name); ?>" >
                            </div>
                            <div class="form-group">
                                <label class="form-control-label" for="email">Email</label>
                                <input type="text" name="email" class="form-control form-control-alternative" id="email" value="<?php echo e($user->email); ?>">
                            </div> 
                            <div class="form-group">
                                <label class="form-control-label" for="password">Password</label>
                                <input type="text" name="password" class="form-control form-control-alternative" id="password">
                            </div> 
                            <div class="form-group">
                                <label class="form-control-label" for="role">Role</label>
                                <select class="form-control form-control-alternative" id="role" name="role">
                                    <option value="0">Select a Option</option>
                                    <?php $__currentLoopData = $roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($role->id); ?>" <?php echo e(( $role->id == $user->roles[0]->id) ? 'selected' : ''); ?>><?php echo e($role->name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div> 
                            <div class="text-right">
                                <button type="submit" class="btn btn-success mt-4">Update User</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Users\umesh\xampp\htdocs\projects\instagram-stat\resources\views/users/edit.blade.php ENDPATH**/ ?>