<?php $__env->startSection('title', 'Edit Expense'); ?>
<?php $__env->startSection('page-title', 'Edit Expense'); ?>

<?php $__env->startSection('content'); ?>

<div class="d-flex align-items-center gap-3 mb-4">
    <a href="<?php echo e(route('expenses.index')); ?>" class="btn btn-sm btn-light"><i class="bi bi-arrow-left"></i></a>
    <h5 class="fw-700 mb-0" style="color:#1e293b;">Edit Expense</h5>
</div>

<div class="row justify-content-start">
<div class="col-lg-6">
<div class="card table-card p-4">

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

    <div class="row g-3">
        <div class="col-sm-6">
            <label class="form-label fw-500">Date</label>
            <input type="date" name="date" class="form-control"
                   value="<?php echo e(old('date', $expense->date->format('Y-m-d'))); ?>" required>
        </div>
        <div class="col-sm-6">
            <label class="form-label fw-500">Amount (₦)</label>
            <div class="input-group">
                <span class="input-group-text bg-light">₦</span>
                <input type="number" name="amount" class="form-control"
                       value="<?php echo e(old('amount', $expense->amount)); ?>" min="0" step="0.01" required>
            </div>
        </div>
        <div class="col-12">
            <label class="form-label fw-500">Category</label>
            <select name="category" class="form-select" required>
                <?php $__currentLoopData = \App\Models\Expense::CATEGORIES; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($value); ?>" <?php echo e(old('category', $expense->category) === $value ? 'selected' : ''); ?>>
                        <?php echo e($label); ?>

                    </option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>
        <div class="col-12">
            <label class="form-label fw-500">Description</label>
            <input type="text" name="description" class="form-control"
                   value="<?php echo e(old('description', $expense->description)); ?>">
        </div>
    </div>

    <div class="d-flex gap-2 mt-4">
        <button type="submit" class="btn fw-600" style="background:#00a651;color:white;">
            <i class="bi bi-check-lg me-2"></i>Save Changes
        </button>
        <a href="<?php echo e(route('expenses.index')); ?>" class="btn btn-outline-secondary fw-600">Cancel</a>
    </div>
    </form>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\Bunmi\Desktop\crud\resources\views/expenses/edit.blade.php ENDPATH**/ ?>