F
Filament10mo ago
harps

modal notification title

How do I change the notification if the create resource is loaded in a modal? protected function getCreatedNotificationTitle(): ?string { return 'Client created successfully!'; } I can do the above on the edit page but that doesn't change the notification if I create a new client in a modal. Thanks
Solution:
Here is the link (https://filamentphp.com/docs/3.x/actions/prebuilt-actions/create#customizing-the-save-notification) to the docs. An example is below ``` CreateAction::make() ->successNotificationTitle('User registered')...
Jump to solution
3 Replies
Solution
bwurtz999
bwurtz99910mo ago
Here is the link (https://filamentphp.com/docs/3.x/actions/prebuilt-actions/create#customizing-the-save-notification) to the docs. An example is below
CreateAction::make()
->successNotificationTitle('User registered')
CreateAction::make()
->successNotificationTitle('User registered')
harps
harps10mo ago
What's the best way to include variables from the record such as name etc. I have this that works but is it the correct way to do it?
return [
Actions\CreateAction::make()
->successNotificationTitle(function ($record) {
return 'Client ' . $record->client_name . ' created successfully! ';
}),
];
return [
Actions\CreateAction::make()
->successNotificationTitle(function ($record) {
return 'Client ' . $record->client_name . ' created successfully! ';
}),
];
bwurtz999
bwurtz99910mo ago
Yes that's correct