php - How to add SQL query by variable in DB::Select() in Laravel
one text
Solution:
I think your problem is here
$result = DB::select(
"SELECT *
FROM orders
JOIN restaurants ON orders.restauant_id = restaurants.id
WHERE orders.status = 'complete'". $restaurantSql. "AND
orders.created_at >= :start_date",
["restaurant_sql" => $restaurantSql, "start_date" => $startDate]
);
Source