<!DOCTYPE html>
<html>
<head>
    <title>Edit Product</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="p-4">

<h3>Edit Product</h3>

<form method="POST" action="{{ route('products.update',$product) }}">
@csrf
@method('PUT')

<input class="form-control mb-2" name="name" value="{{ $product->name }}">
@if($product->image)
    <div class="mb-2">
        <img src="{{ asset('storage/'.$product->image) }}" width="100">
    </div>
@endif

<input type="file" name="image" class="form-control mb-2">
<input class="form-control mb-2" name="price" value="{{ $product->price }}">
<input class="form-control mb-2" name="quantity" value="{{ $product->quantity }}">
<textarea name="description" class="form-control mb-2" placeholder="Product Description">{{ $product->description }}</textarea>


<button class="btn btn-success">Update</button>
</form>

</body>
</html>

