/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, $issue) { if (Gate::denies('update-issue')) { abort(403); } $issue->setAll($request); $issue->syncLocations($request->location); if ($request->published) { Alert::updateAlert($issue, 'Issue\\Issue'); } else { Alert::deleteUnsentAlert($issue, 'Issue\\Issue'); } if ($request->addToLegalNews) { $this->addToLegalNews($issue); } return $issue; }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(NewsRequest $request, $news) { if (Gate::denies('update-news')) { abort(403); } $news->setAll($request); if ($request->published) { Alert::updateAlert($news, 'Issue\\News'); } else { Alert::deleteUnsentAlert($news, 'Issue\\News'); } return $news; }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(ReportRequest $request, $report) { if (Gate::denies('update-reports')) { abort(403); } $report->setAll($request); if ($request->published) { Alert::updateAlert($report, 'Issue\\Report'); } else { Alert::deleteUnsentAlert($report, 'Issue\\Report'); } return $report; }