© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
kingtox

Eager loading relationships in table

I have a table and i am trying to check each row user value, the closure is working correctly, however it's checking for each user id in separate query.


TextColumn::make('2fa')
                    ->label('2FA Enable')
                    ->icon(fn($record) => $record->user->hasTwoFactorEnabled() === true ? 'heroicon-o-badge-check' : 'heroicon-o-x-circle'),

TextColumn::make('2fa')
                    ->label('2FA Enable')
                    ->icon(fn($record) => $record->user->hasTwoFactorEnabled() === true ? 'heroicon-o-badge-check' : 'heroicon-o-x-circle'),


please check screenshot as well. Any help? thank you.
Screenshot_2023-04-12_at_9.07.36_AM.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Eager loading relationships in table
FilamentFFilament / ❓┊help
2y ago
Repeaters and eager loading relationships
FilamentFFilament / ❓┊help
2y ago
Using eager loaded relationships in custom table column views
FilamentFFilament / ❓┊help
2y ago
Eager loaded relationships filter
FilamentFFilament / ❓┊help
2y ago