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

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -