elargento23
9 months ago
349
10
Laravel

Can't see the complete query so I don't know what's wrong

Posted 9 months ago by elargento23

I have the following function: public function second($degree_id) {

    $question = DB::table('questions')
        ->select('questions.question_text','questions.answer_time_minutes','questions.answer_time_seconds')
        ->join('universities', 'universities.university_id', 'questions.university_id')
        ->orderByRaw('RAND()')
        ->where('questions.degree_id', $degree_id)
        ->take(1)->first();

    return view('2ndscreen', compact('question'));
}

This query it is supposed to:

  • Get some columns from question table (question_text, questions.answer_time_minutes and questions.answer_time_seconds)
  • Match university_id columns from questions and universities tables
  • Random order
  • Show the questions whose questions.degree_id is equal to the value passed through the function.

Is there any way to see this query in raw format so I can find out what's wrong?

Thank you

Please sign in or create an account to participate in this conversation.