コード例 #1
0
 public function destroy(Request $request, Student $student)
 {
     $student->delete();
     if ($request->ajax() || $request->wantsJson()) {
         return new JsonResponse($student);
     }
     return redirect('students');
 }
コード例 #2
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy(Request $request, Student $student)
 {
     $student->delete();
     if ($request->ajax() || $request->wantsJson()) {
         return new JsonResponse($student);
     }
     flash()->success('cancellato tutto!');
     return redirect('students');
 }