Example #1
0
 public function handle($command)
 {
     $paste = $this->pasteRepository->getByHash($command->hash);
     $fork = $paste->fork($command->author, $command->code);
     $this->pasteRepository->save($fork);
     return new ForkPasteResponse($fork);
 }
Example #2
0
 public function handle($command)
 {
     $paste = Paste::createPaste($command->author, $command->code);
     $this->pasteRepository->save($paste);
     return new CreatePasteResponse($paste);
 }