ashewalton
3 years ago
1013
3
Laravel

Eloquent query ->toSql returning '?' for 3rd argument??

Posted 3 years ago by ashewalton

I'm new to Laravel, and I have created an eloquent query that's not working, so to troubleshoot I've output the SQL query.

$notepads = Notepad::where('id','1')->toSql
$notepads = Notepad::where('id','=','1')->toSql

In both instances it outputs the query select * from notepads where id = ? where I'm looking for a result of select * from notepads where id = 1

A similar instance of the same query WAS working, now it isn't. I'm just baffled as to why this seemingly simple query won't work.

Please sign in or create an account to participate in this conversation.