コード例 #1
0
 public function deleteReports(DeleteReportRequest $request, AppMailer $mailer)
 {
     $input = $request->all();
     $reports = ExpenseReport::find($input['report_ids']);
     $reports->load('users', 'owner');
     foreach ($reports as $report) {
         $report->delete();
         $mailer->sendReportDeletedNotification($report);
     }
     session()->flash('message', count($input['report_ids']) . " Report(s) deleted");
     return redirect('/expenseReports?sortBy=' . $input['sortBy'] . '&sortOrder=' . $input['sortOrder']);
 }