You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there! I'd like to know if there is a way to get resources sorted by a scope? I know the package allow realize sorting by columns of the model but if I need realize sort by a related resource? Or by countable related resource?
Something like this:
public function scopeSortByLikes($query)
{
return $query->withCount('likes')
->orderBy('likes_count', $direction);
});
}
Thanks!
The text was updated successfully, but these errors were encountered:
Good suggestion... I've added something to the adapter so you can implement the sortByLikes method on the adapter. An example is now in the sorting chapter of the docs - at the end of the chapter.
This will be in 2.2.0 and 3.0.0 - I'm just sorting out tagging versions at the moment.
Awesome man! Thanks for answer me and taking my suggestion on count
El mié., 9 sept. 2020 9:15 a. m., Christopher Gammie <
[email protected]> escribió:
Hi there! I'd like to know if there is a way to get resources sorted by a scope? I know the package allow realize sorting by columns of the model but if I need realize sort by a related resource? Or by countable related resource?
Something like this:
Thanks!
The text was updated successfully, but these errors were encountered: