With normal mysql, you'd add a - sign before the column, like -images_id. Don't know if that will work with query builder/eloquent or not, but it if doesn't you can use orderByRaw() and manually enter your order portion of the query.
Aug 6, 2017
4
Level 2
How to write Eloquent OrderBy() to put null columns to the last
Please hoe can I write an eloquent query to sort result by a column making all the null columns item appear last. Here is my code
->orderBy('images_id', 'DESC') // This should show the ones with value first
->distinct()->Paginate(24);
Please or to participate in this conversation.