Is there a clean way to enable certain models to be ordered by a property by default? It could work by extending the laravel\'s QueryBuilder, but to do so,
A note from my experience, never to use orderBy and GroupBy such term on global scope. Otherwise you will easily face database errors while fetching related models in other places.
Error may be something like:
"ORDER BY "created_at" is ambiguous"
In such case the solution can be giving table name before column names in your query scope.
"ORDER BY posts.created_at"
Thanks.