© 2026 Hedgehog Software, LLC

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

Edit Table Action only populating fields of the first row

Below code works fine when I click on Edit action, fields of that row getting populated
->query(Plan::where('is_private', 0)
    ->orderBy('price', 'ASC')
)
->query(Plan::where('is_private', 0)
    ->orderBy('price', 'ASC')
)


But when I update the query and click on Edit for any row, fields of the first row are getting populated

->query(Plan::where('is_private', 0)
    ->orWhereIn('id', function($query){
        $query->select('plan_id')
            ->from(with(new UserPlan)->getTable())
            ->where('user_id', auth()->user()->id);
    })
    ->orderBy('price', 'ASC')
)
->query(Plan::where('is_private', 0)
    ->orWhereIn('id', function($query){
        $query->select('plan_id')
            ->from(with(new UserPlan)->getTable())
            ->where('user_id', auth()->user()->id);
    })
    ->orderBy('price', 'ASC')
)


My use case: I want to show public plans to all users and show private plan if its assigned to that user.
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

Table action only for specific row?
FilamentFFilament / ❓┊help
3y ago
TableAction in the first row of a table
FilamentFFilament / ❓┊help
3y ago
Custom table row action
FilamentFFilament / ❓┊help
3y ago
Action on click row table
FilamentFFilament / ❓┊help
2y ago