Exemplo n.º 1
0
 /**
  * Creates a new report on the specified event.
  *
  * @param ReportRequest $request
  * @param int|string    $eventId
  *
  * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
  */
 public function store(ReportRequest $request, $eventId)
 {
     $report = $this->event->createReport($request, $eventId);
     if ($report) {
         $message = "Successfully created event report.";
         return redirect()->route('maintenance.events.show', [$eventId, '#tab-report'])->withSuccess($message);
     } else {
         $message = "There was an issue creating a report for this event. Please try again.";
         return redirect()->route('maintenance.events.show', [$eventId, '#tab-report'])->withErrors($message);
     }
 }