Skip to content

Instantly share code, notes, and snippets.

@Mulkave
Created January 23, 2017 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mulkave/a34eee20d485a632eb71c9865653b34e to your computer and use it in GitHub Desktop.
Save Mulkave/a34eee20d485a632eb71c9865653b34e to your computer and use it in GitHub Desktop.
<?php
class ProcessArticleCoverOperation extends Operation
{
public function handle(Request $request)
{
$photo = $this->run(MakePhotoFromDataJob::class, ['data' => $request->input('photo')]);
$this->run(new ValidateCoverPhotoDimensionsJob($photo));
$variations = $this->run(new GeneratePhotoVariationsJob($photo));
$uploads = $this->run(new UploadFilesToCdnJob($variations));
$cover = $this->run(new MakeCoverFromVariationUploadsJob($uploads));
$this->run(CleanFilesInDirectoryJob::class, [
'files' => $variations,
'directory' => $this->run(GetImagesStorageLocationJob::class),
]);
return $cover;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment