/** * Execute the command. * * @param DraftRepositoryInterface $repository */ public function handle(DraftRepositoryInterface $repository) { /** * Delete Draft */ $repository->delete($this->draft->id); }
/** * Execute the command. * * @param DraftRepositoryInterface $repository * @param Dispatcher $event */ public function handle(DraftRepositoryInterface $repository, Dispatcher $event) { /** * Create Idea Draft */ $draft = $repository->create($this->project_id, $this->user->id, $this->type, $this->fields); /** * Announce DraftWasCreated */ $event->fire(new DraftWasCreated($draft)); }