Laravel Pro Tips
#eloquent #sorting
🔥 #Laravel Tip: Make use of ‘orderByRaw’ when you need to sort records in a more complex manner than simply A-Z or Z-A. Here’s an example where I sort ‘roles’ based on their level of importance (rather than their alphabetical order).
Matt Kingshott
#Laravel Tip 🔥 You can use 'latest' and 'oldest' methods to order the results. By default the results will be sorted by created_at column. If you want to sort the results based on a specific column, you can do so as well.
Gurmandeep Singh
No articles were found.