alexvolley's avatar

Rotate image before upload with livewire

Hi,

I'm looking to try build the functionality to rotate an image with its temporaryUrl prior to saving it permanently with livewire.

Currently I am displaying the image with its temporaryUrl before saving it permanently to S3 however I need to allow the user to adjust its rotation before the final save.

I was previously using this when I was not using livewire however it doesn't seem to be working with the temporary files http://image.intervention.io/

Anyone done this before or know of an easy way to achieve this?

0 likes
1 reply
alexvolley's avatar

I got this working, this was the solution :)

public function rotate($degrees) {
        $source = Image::make($this->newSig->getRealPath());
        $source->rotate($degrees)->save();
        $source->stream();
    }
1 like

Please or to participate in this conversation.