This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
By: Arief Hikam | |
Laravel Sorting from another table with Eloquent | |
Sometimes it is difficult to perform sorting by Eloquent because relationships do not use the JOIN in query builder but use | |
Eager Load which mean we can not sorting by another table field because the field is doesn't exist. | |
This is how we use the simple code Eloquent and sorting another table by using LEFT JOIN. | |
I think this is the simplest way I can think of. |