

<?php $__env->startSection('title', 'تعديل صورة اللعبة'); ?>

<?php $__env->startSection('content'); ?>
<div class="container-fluid">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <h1 class="h3 mb-1">تعديل صورة اللعبة: <?php echo e($game->name); ?></h1>
        <a href="<?php echo e(route('admin.games.index')); ?>" class="btn btn-outline-secondary">
            <i class="fas fa-arrow-left me-2"></i>
            العودة
        </a>
    </div>

    <div class="card">
        <div class="card-body">
            <form action="<?php echo e(route('admin.games.update', $game->id)); ?>" method="POST" enctype="multipart/form-data">
                <?php echo csrf_field(); ?>
                <?php echo method_field('PUT'); ?>

                <?php if($game->image_path): ?>
                <div class="mb-3">
                    <label class="form-label d-block">الصورة الحالية:</label>
                    <img src="<?php echo e(asset('storage/' . $game->image_path)); ?>" alt="<?php echo e($game->name); ?>" class="img-thumbnail" style="max-width: 200px;">
                </div>
                <?php endif; ?>

                <div class="mb-3">
                    <label for="image" class="form-label"><?php echo e($game->image_path ? 'اختر صورة جديدة لتغييرها' : 'اختر صورة للعبة'); ?> <span class="text-danger">*</span></label>
                    <input class="form-control <?php $__errorArgs = ['image'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" type="file" id="image" name="image" required>
                    <small class="form-text text-muted">يفضل أن تكون الأبعاد متناسقة.</small>
                    <?php $__errorArgs = ['image'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <div class="invalid-feedback"><?php echo e($message); ?></div>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                </div>

                <div class="d-flex justify-content-end">
                    <button type="submit" class="btn btn-primary">
                        <i class="fas fa-save me-2"></i>
                        حفظ الصورة
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\couples_app_api\resources\views\admin\games\edit.blade.php ENDPATH**/ ?>