Writing a SQL Query into Eloquent

Posted 2 months ago by bobmyles

I have a query as below, I am struggling to write it into Eloquent,

SELECT id, description FROM turnovers ORDER BY CASE WHEN id = (SELECT MAX(id) FROM turnovers) THEN 0 ELSE 1 END, id;

The model is Turnover.

Any help is appreciated.

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

Reply to

Use Markdown with GitHub-flavored code blocks.