Update related table

I have a custom action which opens a modal, and create records in a related table. I would like to emit a event to update the related table after the record is created. Is there any way to do this?

My NoteResource:

"->schema([ Actions::make([ Action::make('Send epost') ->disabled(fn(string $operation) :bool => $operation === 'create') ->form([ TextInput::make('type') ->required() ->placeholder(fn ($record) => $record->body) ->maxLength(255), Forms\Components\Textarea::make('content'), Forms\Components\TextInput::make('customer_id') ->default(fn ($record) => $record->customer_id ?? null), Forms\Components\TextInput::make('note_id') ->default(fn ($record) => $record->id ?? null), ]) ->action(function (array $data, string $model): Conversation { Notification::make() ->success() ->title('Epost sendt') ->send(); return Conversation::create($data); }), Action::make('Send sms') ->color('gray') ->action(function () { // do something }), Action::make('Nytt notat') ->color('gray') ->action(function () { // do something }) ]),"
Screenshot_2023-09-05_at_19.12.46.png
Was this page helpful?