// where clause on json field
$redLovers = DB::table('users')
->where('meta->favorite_color', 'red')
->get();
// update on a json field
DB::table('users')
->where('id', 1)
->update(['meta->wants_newsletter' => false]);
@LOSTDREAMER_NL - The first section of the code doesn't have an update function and the where clause on the second update function is not querying a json column
@magero, then throw the 2 together.... come one, programming is about solving problems right?
// update on a json field
DB::table('codes')
->where('items_code->code', request()->code)
->update(['items_code->status' => 'sold']);
// or ofcourse by model
Code::where('items_code->code', request()->code)
->update(['items_code->status' => 'sold']);