Answers for "livewire file upload without form"

0

livewire validation.mimes

@if ($photo)
        @php
            try {
               $url = $photo->temporaryUrl();
               $photoStatus = true;
            }catch (RuntimeException $exception){
                $this->photoStatus =  false;
            }
        @endphp
        @if($photoStatus)
            <img src="{{ $url }}">
        @else
            Something went wrong while uploading the file.
        @endif
    @endif
Posted by: Guest on December-03-2020

Browse Popular Code Answers by Language