mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
* Issue #17817: Update 03-testing-tables.md - "Testing that a column can be sorted" Currently, the documentation includes a flaky test as an example for sorting a column. This is because Filament sorts its table records according to the underlying database strategy. Previously, the documentation suggested using the `sortBy()` method on the collection returned by the factory. However, this approach does not account for differences in how various databases handle sorting, which can lead to inconsistent test results. With this commit, the documentation has been updated. The example test now uses a stable approach that explicitly orders records through the database query, ensuring reliable behavior across different database systems. Signed-off-by: Merdin <me@merdin.dev> * Update 03-testing-tables.md - "Testing that a column can be sorted" Improve query Signed-off-by: Merdin <me@merdin.dev> * Update 03-testing-tables.md Change `orderBy('title', 'desc')` to `orderByDesc('title')` to improve code readability. Signed-off-by: Merdin <me@merdin.dev> * Update 03-testing-tables.md Signed-off-by: Merdin <me@merdin.dev> * Refactor post sorting in test to use query builder Signed-off-by: Dan Harrin <git@danharrin.com> * Fix sorting order for posts by title Signed-off-by: Dan Harrin <git@danharrin.com> --------- Signed-off-by: Merdin <me@merdin.dev> Signed-off-by: Dan Harrin <git@danharrin.com> Co-authored-by: Dan Harrin <git@danharrin.com>