/** * Add method to save file to S3 server. * * @param null $path * @param null $quality * @return $this */ public function saveToS3($path = null, $quality = null) { $path = is_null($path) ? $this->basePath() : $path; $data = $this->encode(pathinfo($path, PATHINFO_EXTENSION), $quality); Flysystem::put($path, $data, ['visibility' => 'public']); return $this; }