© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
8 replies
Pritbor

MorphToSelect is too slow

MorphToSelect for reading from large database is too slow. Is there any better alternative or any approach i can apply for chunking here. I have Member model which has MorphOne relationship with Company and User models. I need to select member in lets say LeadResource. Below is the code:-

Group::make()
    ->relationship('member')
    ->schema([
            MorphToSelect::make('memberable')
                ->types([
                    MorphToSelect\Type::make(User::class)
                        ->titleAttribute('name'),
                    MorphToSelect\Type::make(Company::class)
                        ->titleAttribute('name')
                ])
                ->label('Member')
                ->required()
                ->searchable()
                ->preload()
                ->optionsLimit(5),
            ]),
Group::make()
    ->relationship('member')
    ->schema([
            MorphToSelect::make('memberable')
                ->types([
                    MorphToSelect\Type::make(User::class)
                        ->titleAttribute('name'),
                    MorphToSelect\Type::make(Company::class)
                        ->titleAttribute('name')
                ])
                ->label('Member')
                ->required()
                ->searchable()
                ->preload()
                ->optionsLimit(5),
            ]),
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

live is too slow
FilamentFFilament / ❓┊help
3y ago
FilamentPHP too slow
FilamentFFilament / ❓┊help
3y ago
The huge form is too slow
FilamentFFilament / ❓┊help
2y ago
Filament admin response too slow
FilamentFFilament / ❓┊help
7mo ago