Ejemplo n.º 1
0
 /**
  * Handle the command.
  *
  * @param  CreatePageCommand  $command
  * @return void
  */
 public function handle(CreatePageCommand $command)
 {
     $active = $command->active === 'on' ? 1 : 0;
     $page_object = Pages::make($command->title, $command->content, $active);
     $page = $this->repo->save($page_object);
     $page->categories()->sync($command->categories);
     $page->tags()->sync($command->tags);
     Event::fire(new PageWasCreated($page));
     return $page;
 }