コード例 #1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $exercises = Exercise::all();
     return view('exercises.index', compact('exercises'));
 }
コード例 #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return Response::json(Exercise::all());
 }
コード例 #3
0
 public function all()
 {
     if (!Auth::check()) {
         // The user is logged in...
         return redirect('auth/login');
     }
     $exercises = Exercise::all();
     return response()->json(array('success' => true, 'data' => $exercises));
 }