Skip to content

Conversation

@mahmoudmohamedramadan
Copy link
Contributor

This PR extends the mergeHidden and mergeVisible methods to Eloquent Collections, allowing you to adjust attribute visibility across an entire collection—not just individual models.

use App\Models\User;

$users = User::withWhereHas('comments')->get();

$users->mergeVisible(['updated_at']);

@taylorotwell taylorotwell merged commit a423636 into laravel:12.x Dec 12, 2025
72 checks passed
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.

2 participants