Does filament add a default orderBy to relation manager queries?
Hi all,
I have a simple relation manager but running into this error when its loading:
The issue is that I'm not ordering the query at all!
I've tried to remove all of the ordering using:
- https://laravel.com/docs/12.x/queries#removing-existing-orderings
but that hasn't worked.
Anyone have any ideas as to where the order could be being applied?
Thanks
Database: Query Builder - Laravel 12.x - The PHP Framework For Web ...
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
3 Replies
It's likely ordering by
$recordTitleAttribute by default. You can set a default sort by doing ->defaultSort('created_at', 'desc') on your $table schemaI've got
which it does order by but for some reason it adds an orderBy on name first, this is the ordering from the error:
Solution
Managed to fix this by using