lundi 22 octobre 2018

Laravel Query - whereJsonContains() reverse

It's possible to write in Laravel query reverse for whereJsonContains() query, something like: whereJsonDoesntContains()?

I have problem with data filtering in Model. This code works perfectly:

              $query->whereHas('attributes', function($q) use ($attribute)
              {
                  $q->where('attribute_product.attribute_id', $attribute->id)
                    ->whereJsonContains('attribute_product.values', $someValue);
                });

Now I want to create another query that returns products whereHas attributes with ID and JSON array in values column doesn't contain my variable.

Do you have any idea to do this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire