Advertisement
Guest User

Untitled

a guest
Jul 9th, 2020
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. public function tampilPertanyaanIps(){
  2.  
  3. //        $chapters = DailyTest::where([["subject_id", "=", 1], ["grade_id", "=", 1], ["chapter_id", "=", 1]])->get();
  4.  
  5.         $chapters = DB::table('daily_tests')
  6.             ->join('grades','daily_tests.grade_id','=','grades.id')
  7.             ->join('subjects','daily_tests.subject_id','=','subjects.id')
  8.             ->join('chapters','daily_tests.chapter_id','=','chapters.id')
  9.             ->select('grades.name','subjects.name','chapters.name','daily_tests.question')
  10.             ->where('grades.id','=',1)
  11.             ->where('subjects.id','=',1)
  12.             ->where('chapters.id','=',10)
  13.             ->get();
  14.         return response()->json(['data' => $chapters], 200);
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement