title: How to sort/order a model's fields?
body: <p>I do <code>$users = User::all();</code> This gives me a collection of User objects, where each object has fields something like:</p>
  
  <pre><code>[   
      {
        "id":10,
        "age":10,
        "name":"John",
        "bank_no":5454
  
     },
     {
        "id":20,
        "age":10,
        "name":"Jane",
        "bank_no":457
  
     }
  ]
  </code></pre>
  
  <p>I want each User objects keys to be ordered alphabetically, </p>
  
  <p>For ex:</p>
  
  <pre><code>[   
     {
        "age":10,
        "bank_no":5454      
        "id":10,
        "name":"John"
  
     },
     {
        "age":10,
        "bank_no":457      
        "id":20,
        "name":"Jane"
  
     }
  ]
  </code></pre>
  
  <p>Now I know that this order comes the order in which the fields are defined in the migration file. But, changing the migration is not an option for me.</p>
  
  <p>How can I do this efficiently?</p>