php - Laravel Eloquent - Order by Enum Field -
i need order results enum
field. field, called status
can either open
, close
, or edit
. now, want entries, edit
, open
, , close
order.
is possible laravel eloquent? tried (which sounds ridiculous, thought i'd give try), , didn't work:
survey::orderby('status', 'edit', 'open', 'close')->get();
try this:
survey::orderbyraw("field(status, \"edit\", \"open\", \"close\")")->get();
Comments
Post a Comment