The fault was with quotation marks. Correct query:
DB::select(DB::raw(" SELECT * , (SELECT min(date) FROM Subproducts WHERE Products.id = Subproducts.productid AND date >= ' $minUpcomingDate. %' ) as minDate FROM Products WHERE status = 1 AND upcoming = 1 ORDER BY minDate "));
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community