So I have a json column called settings in the table companies (which has a Laravel model called Company). That column may or may not contain an object called business_key. I try to return only the companies that contain this object.
My query looks like this:
$owners = \Company::where('settings->business_key')->get();
I don't know how to make something like this work. I did not find anything Laravel specific for this. Thank you for your time and help!