odionk's avatar

Livewire Image Preview

I get this error in image upload preview "Call to a member function temporaryUrl() on string"

View:

  <div>
    @if($photo)
      <img src="{{ $photo->temporaryUrl() }}">
    @endif
    <input type="file" wire:model="photo">
  </div>

Class:

  use WithFileUploads;

  public $photo;

    public function render()
    {
        return view('livewire.coach-new');
    }
0 likes
3 replies
Snapey's avatar

Some other code that you are not showing.

Snapey's avatar

So you don't save photo in your component?

Please or to participate in this conversation.