Skip to content

Conversation

arukompas
Copy link
Contributor

Summary

  • Replace .toArray() with .all() in sortByEarliestFirst() and sortByLatestFirst() methods
  • Preserves Collection type consistency and maintains idiomatic Laravel patterns
  • .all() is the preferred method for direct item access, avoiding unnecessary serialization overhead

Test Plan

✅ All 240 tests pass with the changes

Details

The original code used .toArray() which performs additional formatting and serialization. Using .all() is more idiomatic and aligns with how Laravel internally mutates Collections.

@arukompas arukompas self-assigned this Oct 17, 2025
Replace .toArray() with .all() in sortByEarliestFirst() and sortByLatestFirst()
to preserve Collection type consistency and maintain idiomatic Laravel patterns.
@arukompas arukompas force-pushed the fix/logfilecollection-sorting-mutation branch from 81dc88e to 415e15a Compare October 17, 2025 06:40
Update LogFileCollection and LogFolderCollection to use .all() instead
of .toArray() in all sorting methods for idiomatic Laravel patterns and
Collection type consistency.
@arukompas arukompas merged commit 30a281e into main Oct 17, 2025
26 checks passed
@arukompas arukompas deleted the fix/logfilecollection-sorting-mutation branch October 18, 2025 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant