I have the following SQL, and couldn't insert into Laravel's builder:
LEFT JOIN members ON JSON_SEARCH(places.member_ids, 'one', members.id) IS NOT NULL
I tried:
->leftJoin("members", DB::raw("JSON_SEARCH(places.member_ids, 'one', members.id)"), "is", DB::raw("not null"))
But the generated SQL kept becoming:
left join `members` on JSON_SEARCH(places.member_ids, 'one', members.id) = `is`
How can I do joining on JSON is not null?
EDIT
I found a mitigation for my case. I'm not sure why it works but it works.
->leftJoin("members", DB::raw("JSON_SEARCH(places.member_ids, 'one', members.id)"), "!=", DB::raw("''"))