Level 24
You have to remove ->get() from the $code query.
4 likes
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi there, I'm trying to create a query with union this are my query: $code = DB::table('articles') ->leftjoin('aliquoteiva', 'vat_id', '=', 'serial') ->where('code', 'like', '%'.$nome.'%') ->where('company_id',$company_id) ->get();
$articles = DB::table('articles')
->leftjoin('aliquoteiva', 'vat_id', '=', 'serial')
->where('article', 'like', '%'.$nome.'%')
->where('company_id',$company_id)
->union($code)
->get();
but when I try to show $articles I got this error message: BadMethodCallException Method getBindings does not exist.
Please or to participate in this conversation.