Level 102
Replace with() with load() or move it before find(). And remove ->get() at the end
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello. What's wrong with this query? I can't seem to get it return the correct value
$offerwall = OfferWall::find($offerwall)->with(['offer'=> function($query) use ($proxy_results) {
$query->where('status', 'active')->whereHas('targeting', function($query) use ($proxy_results) {
$query->where('targeting_details.countries_allowed','like', "%\"{$proxy_results['154.159.237.197']['country']}\"%");
});
}])->get();
Replace with() with load() or move it before find(). And remove ->get() at the end
Please or to participate in this conversation.