Skip to content

Commit

Permalink
Feature Form now shows image properly
Browse files Browse the repository at this point in the history
  • Loading branch information
spitfire305 committed Mar 5, 2024
1 parent c6faa3a commit cb7c940
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/Livewire/Roadmap/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class Form extends Component

public bool $success = false;

public int $iteration = 0;

public $duplicates;

public function save()
Expand All @@ -49,6 +51,8 @@ public function save()
$this->success = true;
$this->title = '';
$this->description = '';
$this->file = null;
$this->iteration++;
}

public function updated()
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/roadmap/form.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

<div class="field field-description">
<label>An image is worth a thousand words. Show us how you think the idea should look like.</label>
<input type="file" wire:model="file" class="w-full" accept=".jpg, .jpeg, .png" id="{{ rand() }}">
<input type="file" wire:model="file" class="w-full" accept=".jpg, .jpeg, .png" id="upload-{{ $iteration }}">
<div>
@error('file') <span class="text-red-300">{{ $message }}</span> @enderror
</div>
Expand Down

0 comments on commit cb7c940

Please sign in to comment.