/** * Update the specified resource in storage. * * @param int $id * * @return Response */ public function updateResponse($id, ResponseFormRequest $formRequest) { $proposal = $this->proposalsRepository->find($id); $input = $formRequest->except('_token', '_method'); $input['responder_id'] = Auth::user()->id; //Create ProposalHistory Object $proposal_history = new ProposalHistory(); //Get attributes from Proposals Eloquent $proposal_history->setRawAttributes(array_except($proposal->getAttributes(), ['id', 'created_at', 'updated_at'])); //Append Update Info + Response $proposal_history->proposal_id = $id; $proposal_history->update_id = Auth::user()->id; $proposal_history->update_date = Carbon::now(); $proposal_history->response = $input['response']; $proposal_history->responder_id = $input['responder_id']; //Save History $proposal_history->save(); //Then update Proposal $proposal->forcefill($input)->save(); return redirect()->route('proposals')->with('proposal_crud_msg', 'Ideia Legislativa Respondida com Sucesso'); }
/** * Handle the event. * * @param ProposalWasCreated $event * * @return void */ public function handle(ProposalWasCreated $event) { $this->repository->sendProposalToCreator($event->getProposal()); }
/** * Handle the event. * * @param ProposalApprovedByCommittee $event * * @return void */ public function handle(ProposalApprovedByCommittee $event) { $this->repository->sendProposalApprovedByCommittee($event->getProposal()); }
/** * Handle the event. * * @param ProposalTimeLimit $event * * @return void */ public function handle(ProposalTimeLimit $event) { $this->repository->sendProposalTimeLimit($event->getProposal()); }
/** * Handle the event. * * @param ProposalReachedApprovalGoal $event * * @return void */ public function handle(ProposalReachedApprovalGoal $event) { $this->repository->sendProposalApprovalGoalNotification($event->getProposal()); }
/** * Handle the event. * * @param ProposalClosed $event * * @return void */ public function handle(ProposalClosed $event) { $this->repository->sendProposalClosed($event->getProposal()); }
/** * List: Disapproved Proposals by Committee. * * @param void * * @return Response */ public function disapprovedByCommittee() { $proposals = $this->proposalsRepository->disapprovedByCommittee(); return view('admin.proposals.disapproved-by-committee')->with('disapprovedsByCommittee', $proposals); }