I have 2 model Basket and product my product table has json object column and I write code like this
            $basket=Basket::with("product")->whereJsonContains("product->store->id",$stores_id)->get();
But laravel don't return me data. Throw this error
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'product' in 'where clause' (SQL: select * from
shopping_cardswhere json_contains(product->'$.\"store\".\"id\"', 39))
And my data structure like this
{
        "id": 3,
        "users_id": 1,
        "quantity": 1,
        "product": {
            "id": 116,
            "store": {
                "id": 39,
                "status": 41,
            }
         }
}
via Chebli Mohamed
 
Aucun commentaire:
Enregistrer un commentaire