dimanche 28 avril 2019

What is the way to use the one query result in where clause in laravel like we do in sql query using where in clause?

I'm writing query in Laravel but its giving me error Saying

ErrorException: Object of class stdClass could not be converted to string

$subject_ids = DB::table('question_sets')
                   ->select('subject_id')
                   ->where('test_section_id','=',$testDetail->test_section_id)
                   ->distinct()
                   ->get();

$topic_ids = DB::table('topics')
                 ->select('id')
                 ->where('subject_id','=',$subject_ids)
                 ->get();



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire