feat: optimize Eloquent relationship loading patterns (#195)

Commit: f42c6aee9ba2a755a3f61488261b196441911c6f
Date: 2025-07-06 12:55:24 +0200
Author: PascalHavelange

Commit Message

feat: optimize Eloquent relationship loading patterns (#195)

- Refactor factories to use proper dependency injection instead of manual DB queries
- Remove inefficient inRandomOrder()->first() and inRandomOrder()->take() patterns
- Implement smart language selection that reuses existing records when available
- Simplify unit tests by removing manual relationship loading calls
- Improve test reliability by letting factories handle dependencies automatically
- Maintain Laravel best practices for relationship handling

Performance improvements:
- Reduced unnecessary database queries in factory operations
- Faster test execution due to better dependency management
- More predictable factory behavior

All tests pass: 861 tests with 3136 assertions ✅

Co-authored-by: Pascal HAVELANGE <havelangep@hotmail.com>

Files Changed


This documentation was automatically generated from Git commit data.