private function getFileFromOptions($file, $options = [])
    {
        extract($options);

        $originalFilename = "{$file['public_id']}.{$file['format']}";
        $resizedFilename = "{$file['public_id']}_{$width}_{$height}_{$gravity}.{$file['format']}";

        $image = Image::make(Storage::get("{$this->uploadFolder}/{$originalFilename}"));

        if (!$width || !$height) {
            $image->resize($width, $height, function ($constraint) {
                $constraint->aspectRatio();
            });
        } else {
            $image->fit($width, $height);
        }

        $image->save(public_path("/{$this->mediaFolder}/{$resizedFilename}"));

        return "/{$this->mediaFolder}/{$resizedFilename}";
    }
private function getFileFromOptions($file, $options = [])
    {
        extract($options);

        $originalFilename = "{$file['public_id']}.{$file['format']}";
        $resizedFilename = "{$file['public_id']}_{$width}_{$height}_{$gravity}.{$file['format']}";

        $image = Image::make(Storage::get("{$this->uploadFolder}/{$originalFilename}"));

        if (!$width || !$height) {
            $image->resize($width, $height, function ($constraint) {
                $constraint->aspectRatio();
            });
        } else {
            $image->fit($width, $height);
        }

        $image->save(public_path("/{$this->mediaFolder}/{$resizedFilename}"));

        return "/{$this->mediaFolder}/{$resizedFilename}";
    }
private function getFileFromOptions ( $ file , $ options = [ ] ) { extract ( $ options ) ; $ originalFilename = "{$file['public_id']}.{$file['format']}" ; $ resizedFilename = "{$file['public_id']}_{$width}_{$height}_{$gravity}.{$file['format']}" ; $ image = Image :: make ( Storage :: get ( "{$this->uploadFolder}/{$originalFilename}" ) ) ; if ( ! $ width || ! $ height ) { $ image -> resize ( $ width , $ height , function ( $ constraint ) { $ constraint -> aspectRatio ( ) ; } ) ; } else { $ image -> fit ( $ width , $ height ) ; } $ image -> save ( public_path ( "/{$this->mediaFolder}/{$resizedFilename}" ) ) ; return "/{$this->mediaFolder}/{$resizedFilename}" ; }
Process a media item and return the resized version of the file

@param array $file
@param array $options
@return string
Process a media item and return the resized version of the file