Created
January 23, 2017 23:06
-
-
Save Mulkave/886bce8875d7681e0e133441c857c213 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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