© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
4 replies
Will Aguilar

How to get team_id when creating new record from Relation Manager

I have a Relation Manager
ConversionsRelationManager
ConversionsRelationManager
I'm trying to create new record from there but I keep getting
team_id
team_id
doesn't have a default value. I have the normal resource
UnitConversionResource
UnitConversionResource
and I'm able to create new records there with the
team_id
team_id
being passed correctly
Solution
Thanks @tomc actually found probaly a safer way since Users can edit values in hidden fields

->headerActions([
    Tables\Actions\CreateAction::make()->mutateFormDataUsing(function (array $data): array {
        $data['team_id'] = Filament::getTenant()->id;
        return $data;
    })
])
->headerActions([
    Tables\Actions\CreateAction::make()->mutateFormDataUsing(function (array $data): array {
        $data['team_id'] = Filament::getTenant()->id;
        return $data;
    })
])


As mention in the docs - https://filamentphp.com/docs/3.x/actions/prebuilt-actions/create#customizing-data-before-saving
Create action - Actions - Filament
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

How to get record id in relation managers?
FilamentFFilament / ❓┊help
2y ago
How to get record data or just id of a relation manager record.
FilamentFFilament / ❓┊help
3y ago
Set Default when Creating Record from Relation
FilamentFFilament / ❓┊help
5mo ago
Change relation manager to instead creating a new record, select from an existing record to attach.
FilamentFFilament / ❓┊help
3y ago