I am still getting my head around laravel eloquent. I would like to write the following query in eloquent
SELECT * FROM tableA where id = $variableID AND grade_id = $gradeID
I tried the following in eloquent:
$totalGreen = DB::select('SELECT * FROM tableA WHERE id = ? AND grade_id = ?',[$visitdetail->id],[1]);
but I get this error:
SQLSTATE[HY093]: Invalid parameter number (SQL: SELECT * FROM tableA WHERE id = 5 AND grade_id = ?)
I went through the laravel document, but didn't really find anything exclusively answering my question. Please help