Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

MCLTano's avatar

Query into where clause ?

Hi, anyone help me please,

i have this query:


	$allUser = DB::table('users')->join('anything','example.id,'=','example.id')	->select('example.name')
	->where([ ['example.id', $hereIwantAnotherValueOfTheQuery],['example.exm'] ])->get();

but : $hereIwantanotherValueOfTheQuery is another query that i write before, i want know if there are some method to add a query(select id from banks where id=id_bu)) into the where clause. thanks regards.

hereIwantanotherValueOfTheQuery = ->select id from banks where id=id_bu

0 likes
1 reply

Please or to participate in this conversation.