/** * Demotes a single report and returns the user back to the reports page. * Handles /report/{report}/demote * * @param Report $report * @return Response */ public function getDemote(Report $report) { if (!$report->canView($this->user)) { abort(403); } if (!$report->isOpen()) { abort(404); } $report->global = false; $report->promoted_at = $report->freshTimestamp(); $report->promoted_by = $this->user->user_id; $report->save(); return redirect()->back()->withSuccess(trans_choice("panel.reports.demoted", 1, ['reports' => 1])); }