Fix: Сохранение существующих картинок при редактировании
✅ edit.blade.php передаёт existing_image ✅ update() сохраняет existing_image если новый файл не загружен ✅ update() удаляет старую картинку если загружена новая Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
@foreach($question->answers as $answer)
|
||||
<div class="input-group mb-2">
|
||||
<input type="text" name="answers[{{ $loop->index }}][text]" class="form-control" placeholder="Текст ответа" value="{{ $answer->answer_text ?? '' }}">
|
||||
<input type="hidden" name="answers[{{ $loop->index }}][existing_image]" value="{{ $answer->image }}">
|
||||
<input type="file" name="answers[{{ $loop->index }}][image]" class="form-control" accept="image/*">
|
||||
@if($answer->image)
|
||||
<div class="input-group-text">
|
||||
|
||||
Reference in New Issue
Block a user