Implements default sorting behavior when all provided sort parameters are invalid, ensuring the query builder falls back to a predefined default sort order.
Default Sort Application: Modifies addRequestedSortsToQuery in src/Concerns/SortsQuery.php to apply the default sort when no valid sorts are present in the request. This ensures that if all provided sort parameters are invalid, the query builder will use the default sort order specified.
Test Coverage: Adds a new test case in tests/SortTest.php to verify that the default sort is correctly applied when an invalid sort parameter is provided in the request. This test ensures the functionality works as expected and the default sorting is enforced in such scenarios.
Implements default sorting behavior when all provided sort parameters are invalid, ensuring the query builder falls back to a predefined default sort order.
addRequestedSortsToQuery
insrc/Concerns/SortsQuery.php
to apply the default sort when no valid sorts are present in the request. This ensures that if all provided sort parameters are invalid, the query builder will use the default sort order specified.tests/SortTest.php
to verify that the default sort is correctly applied when an invalid sort parameter is provided in the request. This test ensures the functionality works as expected and the default sorting is enforced in such scenarios.For more details, open the Copilot Workspace session.