I am trying to run this SQL query in many ways in laravel but it shows error.
SELECT * FROM reservas WHERE cliente_id = 2201 AND dia >= '2020-10-15' GROUP BY dia
I have tried to run this query but I get a violation error
DB::select('SELECT * FROM reservas WHERE cliente_id = :id AND dia >= :date GROUP BY dia', ['id' => $id, 'date' => $date]);
The variables that I send have data, that is, the error does not come from empty variables, far from it, but the error comes from the query. It should be noted that this query does work in SQL.
selectRaw, notselect.Call to undefined method Illuminate\Database\MySqlConnection::selectRaw()GROUP BYwithout selecting any aggregates? Your current query does not make sense.