Mahfuz Shaikh Posted on Nov 4, 2021 Could you tell the issue? #php #laravel #database #help Hey thank you for reading and helping me :) The above Laravel eloquent queries giving different result. Could you tell the difference? I am one step away from pulling my hair . Top comments (3) Subscribe Submit Preview Dismiss Collapse Expand Lito Lito Lito Follow Joined May 12, 2017 • Nov 4 '21 Dropdown menu Copy link Hide You can view the SQL query using the toSql() method instead count. Collapse Expand Mahfuz Shaikh Mahfuz Shaikh Mahfuz Shaikh Follow Location Khulna, Bangladesh Joined Apr 29, 2018 • Nov 4 '21 Dropdown menu Copy link Hide Yes I know, but why it's giving different result? Collapse Expand Ben Sinclair Ben Sinclair Ben Sinclair Follow I'm an ex-sysadmin from the late 20th century. These days I do more software architecture and whatnot, and promote UX and accessibility. Location Scotland Education Something something cybernetics Pronouns They/them Work General-purpose software person Joined Aug 29, 2017 • Nov 4 '21 Dropdown menu Copy link Hide The idea is that if you compare the SQL that's generated you'll be able to see what they're doing differently underneath their abstraction layer. If the abstraction layer is giving inconsistent results then it's not a very good tool, but I've heard eloquent is supposed to be decent, so ¯_(ツ)_/¯ Code of Conduct • Report abuse
Top comments (3)
You can view the SQL query using the
toSql()method insteadcount.Yes I know, but why it's giving different result?
The idea is that if you compare the SQL that's generated you'll be able to see what they're doing differently underneath their abstraction layer.
If the abstraction layer is giving inconsistent results then it's not a very good tool, but I've heard eloquent is supposed to be decent, so ¯_(ツ)_/¯