How to save newly deleted user information to the notification database
Hello, how can I save a notification in the database when deleting a resource? I want to notify that the user with that id has been deleted.
Below is the code when I create a new user, I want my deletion notification to be similar to the creation, it will display the information of the newly deleted user.
protected function getRedirectUrl(): string { $recipient = auth()->user(); $data = $this->record; Notification::make() ->title('New user has been created by ' . $recipient['name'] . ' ['.$recipient['id'].']') ->body('User '.$data['name'].' - ID: '.strtoupper($data['id']).' đã được tạo thành công.') ->sendToDatabase($recipient); return $this->getResource()::getUrl('index'); }
protected function getRedirectUrl(): string { $recipient = auth()->user(); $data = $this->record; Notification::make() ->title('New user has been created by ' . $recipient['name'] . ' ['.$recipient['id'].']') ->body('User '.$data['name'].' - ID: '.strtoupper($data['id']).' đã được tạo thành công.') ->sendToDatabase($recipient); return $this->getResource()::getUrl('index'); }




0 Replies