© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
4 replies
David | Fortune Validator

Eager load or lazy load on modals?

Sorry for the silly question. I have an Edit modal for a record on my table. I am using
$record->supplier
$record->supplier
in multiple places (
supplier
supplier
being a relationship which gets the supplier modal for the table record ). Is a query being run each time to get the supplier info or is it eager loaded the once?

Thanks all. I am running
$record->supplier
$record->supplier
maybe five times through the schema so I idealy I didnt want to be running a query five times for the same thing.

Example code usage:
TextInput::make('total')->prefix('£')->required()->numeric()
                        ->live()->debounce()
                        ->afterStateUpdated(fn (Set $set, Get $get, $state, $record) => self::totalsCalc($set, $get, $state, $record->supplier, 'total')),
TextInput::make('total')->prefix('£')->required()->numeric()
                        ->live()->debounce()
                        ->afterStateUpdated(fn (Set $set, Get $get, $state, $record) => self::totalsCalc($set, $get, $state, $record->supplier, 'total')),
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 load issue
FilamentFFilament / ❓┊help
2y ago
Eager load record on Edit Page
FilamentFFilament / ❓┊help
3y ago
Lazy load on custom page
FilamentFFilament / ❓┊help
3y ago
Lazy load tab
FilamentFFilament / ❓┊help
15mo ago