예제 #1
0
 public static function make(\App\Domain\ValueObject\Post $post)
 {
     $details = new Details();
     $details->title = $post->title()->value();
     $details->author = $post->author()->value();
     $details->date = $post->date()->format("Y-m-d");
     return $details;
 }
예제 #2
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle(Dispatcher $dispatcher)
 {
     $id = \App\Domain\ValueObject\UUID::make();
     $title = new \App\Domain\ValueObject\String\NonBlank($this->argument("title"));
     $author = new \App\Domain\ValueObject\String\NonBlank($this->argument("github_username"));
     $post = \App\Domain\ValueObject\Post::make($id, $title, $author);
     $dispatcher->dispatch(new \App\Commands\CreatePost($post));
     $this->info("Post {$id} created.");
 }