<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>

     <?php $__env->slot('header', null, []); ?> 

        <div class="flex items-center justify-between">

            <h2 class="text-2xl font-bold text-slate-800">
                Edit Material
            </h2>

            

        </div>

     <?php $__env->endSlot(); ?>

    <div class="bg-white rounded-3xl shadow-sm p-8 max-w-5xl">

        <form action="<?php echo e(route('materials.update', $material->id)); ?>"
              method="POST">

            <?php echo csrf_field(); ?>
            <?php echo method_field('PUT'); ?>

            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">

                <!-- Name -->
                <div>

                    <label class="font-semibold text-slate-700">
                        Material Name
                    </label>

                    <input type="text"
                           name="name"
                           value="<?php echo e(old('name', $material->name)); ?>"
                           class="w-full mt-2 rounded-2xl border-slate-300 focus:border-blue-500 focus:ring-blue-500">

                    <?php $__errorArgs = ['name'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>

                        <p class="text-red-500 text-sm mt-2">
                            <?php echo e($message); ?>

                        </p>

                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>

                </div>

                <!-- Code -->
                <div>

                    <label class="font-semibold text-slate-700">
                        Material Code
                    </label>

                    <input type="text"
                           name="code"
                           value="<?php echo e(old('code', $material->code)); ?>"
                           class="w-full mt-2 rounded-2xl border-slate-300 focus:border-blue-500 focus:ring-blue-500">

                </div>

                <!-- Unit -->
                <div>

                    <label class="font-semibold text-slate-700">
                        Unit
                    </label>

                    <input type="text"
                           name="unit"
                           value="<?php echo e(old('unit', $material->unit)); ?>"
                           placeholder="KG / PCS / LTR"
                           class="w-full mt-2 rounded-2xl border-slate-300 focus:border-blue-500 focus:ring-blue-500">

                </div>

                <!-- Price -->
                <div>

                    <label class="font-semibold text-slate-700">
                        Price
                    </label>

                    <input type="number"
                           step="0.01"
                           name="price"
                           value="<?php echo e(old('price', $material->price)); ?>"
                           class="w-full mt-2 rounded-2xl border-slate-300 focus:border-blue-500 focus:ring-blue-500">

                </div>

                <!-- Stock -->
                <div>

                    <label class="font-semibold text-slate-700">
                        Stock
                    </label>

                    <input type="number"
                           step="0.01"
                           name="stock"
                           value="<?php echo e(old('stock', $material->stock)); ?>"
                           class="w-full mt-2 rounded-2xl border-slate-300 focus:border-blue-500 focus:ring-blue-500">

                </div>

                <!-- Description -->
                <div class="md:col-span-2">

                    <label class="font-semibold text-slate-700">
                        Description
                    </label>

                    <textarea name="description"
                              rows="5"
                              class="w-full mt-2 rounded-2xl border-slate-300 focus:border-blue-500 focus:ring-blue-500"><?php echo e(old('description', $material->description)); ?></textarea>

                </div>

            </div>

            <!-- Buttons -->
            <div class="flex items-center gap-4 mt-8">

                <button type="submit"
                        class="bg-blue-600 hover:bg-blue-700 text-white px-8 py-3 rounded-2xl font-semibold shadow-lg transition">

                    Update Material

                </button>

                <a href="<?php echo e(route('materials.index')); ?>"
                   class="bg-slate-200 hover:bg-slate-300 text-slate-800 px-8 py-3 rounded-2xl font-semibold transition">

                    Cancel

                </a>

            </div>

        </form>

    </div>

 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?><?php /**PATH C:\xampp\htdocs\manufacturing-system\resources\views/materials/edit.blade.php ENDPATH**/ ?>