YouTube Icon

Code Playground.

How to use Updating JSON Columns in Laravel 5

CFG

How to use Updating JSON Columns in Laravel 5

Laravel 5. * provides a basic syntax based on the value of unique keys in your JSON columns for searches and updates. Also databases that support JSON columns support this operation.

When updating a JSON column, you should use -> this sign.

DB::table('tbl_order')
            ->where('order_id', 101)
            ->update(['options->enabled' => true]);




CFG