<h2>Edit Blog</h2>
<form id="blogForm" action="{{ route('blogs.update', $blog->id) }}" method="POST" enctype="multipart/form-data">
    @csrf
    @method('PUT')

    <div class="mb-3">
        <label>Title</label>
        <input type="text" name="title" class="form-control" value="{{ $blog->title }}">
    </div>

    <div class="mb-3">
        <label>Content</label>
        <textarea id="summernote" name="content" class="form-control">{{ $blog->content }}</textarea>
    </div>

    <div class="mb-3">
        <label>Image</label>
        <input type="file" name="image" class="form-control">
        @if($blog->image)
            <p>Current Image:</p>
            <img src="{{ asset('storage/'.$blog->image) }}" width="100">
        @endif
    </div>

    <button type="submit" class="btn btn-primary">Update</button>
</form>
