

<?php $__env->startSection('content'); ?>
<div class="bg-white shadow rounded p-6 max-w-md mx-auto">
    <h2 class="text-2xl font-bold mb-4">Edit User</h2>

    <form action="<?php echo e(route('user.update', $user->id)); ?>" method="POST">
        <?php echo csrf_field(); ?>
        <?php echo method_field('PUT'); ?>

        <div class="mb-4">
            <label class="block mb-1 font-medium">Name</label>
            <input type="text" name="name" class="w-full border-gray-300 rounded"
                   value="<?php echo e(old('name', $user->name)); ?>" required>
        </div>

        <div class="mb-4">
            <label class="block mb-1 font-medium">Email</label>
            <input type="email" name="email" class="w-full border-gray-300 rounded"
                   value="<?php echo e(old('email', $user->email)); ?>" required>
        </div>

        <div class="mb-4">
            <label class="block mb-1 font-medium">Role</label>
            <select name="role" class="w-full border-gray-300 rounded" required>
                <?php $__currentLoopData = \Spatie\Permission\Models\Role::all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($role->name); ?>"
                        <?php echo e($user->hasRole($role->name) ? 'selected' : ''); ?>>
                        <?php echo e(ucfirst($role->name)); ?>

                    </option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>
        <!-- Permissions -->
        <div class="mb-4">
            <label class="block mb-1 font-medium">Permissions</label>
            <div class="space-y-2">
                <label class="flex items-center">
                    <input type="checkbox" name="can_sell" value="1"
                        class="mr-2" <?php echo e($user->can_sell ? 'checked' : ''); ?>>
                    Can Sell
                </label>
                <label class="flex items-center">
                    <input type="checkbox" name="can_lease" value="1"
                        class="mr-2" <?php echo e($user->can_lease ? 'checked' : ''); ?>>
                    Can Lease
                </label>
                <label class="flex items-center">
                    <input type="checkbox" name="can_rent" value="1"
                        class="mr-2" <?php echo e($user->can_rent ? 'checked' : ''); ?>>
                    Can Rent
                </label>
            </div>
        </div>

        <button type="submit" class="bg-yellow-500 text-white px-4 py-2 rounded">Update</button>
    </form>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\Sw_arif\realState\resources\views/admin/super/edit_user.blade.php ENDPATH**/ ?>