Skip to content

Instantly share code, notes, and snippets.

@Mulkave
Created January 23, 2017 23:06
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/886bce8875d7681e0e133441c857c213 to your computer and use it in GitHub Desktop.
Save Mulkave/886bce8875d7681e0e133441c857c213 to your computer and use it in GitHub Desktop.
<?php
class CreateArticleFeature extends Feature
{
public function handle(Request $request)
{
$this->run(new ValidateArticleInputForCreationJob($request->input()));
// process cover photo
$cover = $this->run(ProcessArticleCoverOperation::class);
// save article
$article = $this->run(CreateArticleJob::class, [
'cover' => $cover,
'title' => $request->input('title'),
'body' => $request->input('body'),
]);
return $this->run(new RespondWithJsonJob($article));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment