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? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -