© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•10mo ago•
4 replies
trovster

AttachAction not adding entries with global scopes.

I am trying to attach a category to a post. Categories have a global scope to hide "machine tags". I have a select field which obviously doesn't show all categories, so added removeGlobalScopes to the query… however, when I SAVE that category relationship, nothing happens – it isn't attached to the post. If I remove the scope from the model or choose a non-machine-tag category it works.

Looking at the AttachAction code I can't work out why the
$record
$record
ends up
null
null
as it is using
Relation::noConstraints()
Relation::noConstraints()
in the action…

AttachAction::make()->recordSelectOptionsQuery(
    static fn (Builder $query): Builder => $query->withoutGlobalScopes()
)
AttachAction::make()->recordSelectOptionsQuery(
    static fn (Builder $query): Builder => $query->withoutGlobalScopes()
)
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

Global Scopes not being ignored on select
FilamentFFilament / ❓┊help
2y ago
global scopes ignored on grouping
FilamentFFilament / ❓┊help
3y ago
How disable global scopes in RepeatableEntry
FilamentFFilament / ❓┊help
14mo ago
AttachAction problem with Relations?
FilamentFFilament / ❓┊help
3y ago