示例#1
0
 /**
  * Get all of the subjects for a given user.
  *
  * @param  User  $user
  * @return Collection
  */
 public function forLectures($lecture_id)
 {
     return Subject::with('topics')->where('subjects.lecture_id', $lecture_id)->orderBy('created_at', 'asc')->get();
 }
 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     return Subject::with('translations')->findOrFail($id)->toArray();
 }