Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel where json contains

  id   |   product_json   
--------------------------------
   1   |   {slug:"test",...}
   2   |   {slug:"test",...}
// Orders Table

Orders::whereJsonContains('product_json->id', "test")->count();
// 2
 
PREVIOUS NEXT
Tagged: #laravel #json
ADD COMMENT
Topic
Name
2+2 =