79435514

Date: 2025-02-13 08:40:58
Score: 1
Natty:
Report link

Below is the code and link from livewire documentation. You can adjust the @if ($photo) and add @else to show default image.

[

`<form wire:submit="save">
    @if ($photo) 
        <img src="{{ $photo->temporaryUrl() }}">
    @endif
 
    <input type="file" wire:model="photo">
 
    @error('photo') <span class="error">{{ $message }}</span> @enderror
 
    <button type="submit">Save photo</button>
</form>`

]1

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @else
  • Low reputation (0.5):
Posted by: tvv3