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

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

ruby - How do I merge two hashes into a hash of arrays? -