skip to Main Content

Laravel whereJsonContains returns No Result in A whereExists Sub Query

This is my current code, when executed will return no results. (Query1) // Get all product categories that has a relation $product_categories = ProductCategory::whereExists(function($query) { $query->select('id') ->from('restaurants') ->whereJsonContains('restaurants.restaurant_categories', 'product_categories.name'); })->get(); // Log dd($product_categories->toSql()); Here an sql query dump select *…

VIEW QUESTION
Back To Top
Search