/**
  * Execute the command.
  *
  * @param IdeaRepositoryInterface $repository
  * @param Dispatcher $event
  */
 public function handle(IdeaRepositoryInterface $repository, Dispatcher $event)
 {
     /**
      * Save the Winner
      */
     $repository->createWinner($this->submission->idea->id, $this->submission->id);
     /**
      * Announce A IdeaWinnerWasSelected
      */
     $event->fire(new IdeaWinnerWasSelected($this->submission->idea));
 }
예제 #2
0
 /**
  * Execute the command.
  *
  * @param IdeaRepositoryInterface $repository
  * @param Dispatcher $event
  */
 public function handle(IdeaRepositoryInterface $repository, Dispatcher $event)
 {
     /**
      * Submit Idea
      */
     $submission = $repository->submit($this->idea->id, $this->user->id, $this->fields);
     /**
      * Announce IdeaWasSubmitted
      */
     $event->fire(new IdeaWasSubmitted($submission, $this->user));
 }
예제 #3
0
 /**
  * Execute the command.
  *
  * @param IdeaRepositoryInterface $repository
  * @param Dispatcher $event
  * @return \DreamsArk\Models\Project\Stages\Idea
  */
 public function handle(IdeaRepositoryInterface $repository, Dispatcher $event)
 {
     /**
      * Create Idea
      */
     $idea = $repository->create($this->project_id, $this->fields->all());
     /**
      * Announce IdeaWasCreated
      */
     $event->fire(new IdeaWasCreated($idea, $this->fields->get('voting_date')));
 }
예제 #4
0
 /**
  * Show Ideas Page
  *
  * @param IdeaRepositoryInterface $repository
  * @return \Illuminate\View\View
  */
 public function index(IdeaRepositoryInterface $repository)
 {
     return view('project.idea.index')->with('ideas', $repository->all());
 }