© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
8 replies
SUNSHINE

Create Action on relation manager, how to generate a password ?

Hello, do you know in a relation manager how can I define a password and send a mail after the creation.. ? Since it's a static method and I can't store the password as a property of my object.

Tables\Actions\CreateAction::make()->mutateFormDataUsing(function (array $data) {
    $data['type'] = UserTypeEnum::PARTNER;
    $data['password'] = ($this->password = Hash::make(Str::random(15))); // don't work on a static method
    return $data;
})->after(fn () => Mail::to($this->record)->send(
    new UserCredentials($this->record, $this->password)
)),
Tables\Actions\CreateAction::make()->mutateFormDataUsing(function (array $data) {
    $data['type'] = UserTypeEnum::PARTNER;
    $data['password'] = ($this->password = Hash::make(Str::random(15))); // don't work on a static method
    return $data;
})->after(fn () => Mail::to($this->record)->send(
    new UserCredentials($this->record, $this->password)
)),
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

Create action with relation manager
FilamentFFilament / ❓┊help
7mo ago
Creating a Create action on a Relation Manager listing
FilamentFFilament / ❓┊help
3y ago
How to refresh relation manager on action?
FilamentFFilament / ❓┊help
2y ago
Relation Manager: How to customize edit action?
FilamentFFilament / ❓┊help
2y ago