Example #1
0
 /**
  * Move an uploaded file to it's intended destination.
  * The file can be an actual uploaded file object or the path to
  * a resized image file on disk.
  *
  * @param  UploadedFile $file 
  * @param  string $filePath
  * @return void 
  */
 public function move($file, $filePath)
 {
     $this->getS3Client()->putObject(['Bucket' => $this->getBucket(), 'Key' => $filePath, 'SourceFile' => $file, 'ContentType' => $this->attachedFile->contentType(), 'ACL' => $this->attachedFile->ACL]);
 }
 /**
  * Register Expstudio\LaraClip\Attachment with the container.
  * 
  * @return void
  */
 protected function registerAttachment()
 {
     $this->app->bind('Attachment', function ($app, $params) {
         $config = $app->make('Config', array('name' => $params['name'], 'options' => $params['options']));
         $interpolator = $app->make('Interpolator');
         $imageProcessor = $app->make($params['options']['image_processing_library']);
         $resizer = $app->make('Resizer', array('imageProcessor' => $imageProcessor));
         $IOWrapper = $app->make('IOWrapper');
         $attachment = new Attachment($config, $interpolator, $resizer, $IOWrapper);
         $storageDriver = $app->make($params['options']['storage'], array('attachment' => $attachment));
         $attachment->setStorageDriver($storageDriver);
         return $attachment;
     });
 }