/** * Execute the command. * * @param StartupRepository $repository * @return static */ public function handle(StartupRepository $repository) { switch ($this->action) { case 'approve': $repository->approveMemberRequest($this->user, $this->startup); Flash::message("Congratulations! {$this->user->profile->first_name} {$this->user->profile->last_name} has been accepted into your startup!"); break; case 'reject': $repository->rejectMemberRequest($this->user, $this->startup); Flash::message("{$this->user->profile->first_name} {$this->user->profile->last_name} has been rejected from your startup!"); break; } return $this->startup; }