/** * Execute the command. * * @param ProjectRepositoryInterface $repository * @param Dispatcher $event */ public function handle(ProjectRepositoryInterface $repository, Dispatcher $event) { /** * Back Expenditure */ $repository->back($this->project->id, $this->user->id, $this->amount); /** * Announce ProjectWasBacked */ $event->fire(new ProjectWasBacked($this->project, $this->user, $this->amount)); }
/** * Execute the command. * * @param ProjectRepositoryInterface $repository * @param Dispatcher $event */ public function handle(ProjectRepositoryInterface $repository, Dispatcher $event) { /** * Update Project Stage */ $repository->nextStage($this->project->id, strtolower(class_basename($this->stage))); /** * Announce ProjectStageWasUpdated */ $event->fire(new ProjectStageWasUpdated($this->project)); }
/** * Show a specific project. * * @param Project $project * @param ProjectRepositoryInterface $repository * @return \Illuminate\View\View */ public function show(Project $project, ProjectRepositoryInterface $repository) { if ($project->stage instanceof Review) { return view('project.show', compact('project')); } if (!$project->stage instanceof Fund) { $submissions = $repository->submissions($project->id)->load('user'); return view('project.show', compact('project'))->with('submissions', $submissions); } return view('project.show')->with('project', $project->load('expenditures.expenditurable', 'backers')); }
/** * Execute the command. * * @param ProjectRepositoryInterface $repository * @param Dispatcher $event * @return Project */ public function handle(ProjectRepositoryInterface $repository, Dispatcher $event) { $type = $this->fields->get('type', 'idea'); /** * Create Project */ $project = $repository->create($this->user->id, $type, $this->fields->all()); /** * Announce ProjectWasCreated */ $event->fire(new ProjectWasCreated($this->user, $project, $this->fields)); }
/** * Show a specific project. * * @param Project $project * @param ProjectRepositoryInterface $repository * @return \Illuminate\View\View */ public function show(Project $project, ProjectRepositoryInterface $repository) { $submissions = $repository->submissions($project->id)->load('user'); return view('project.show', compact('project'))->with('submissions', $submissions); }