Notification inside a table action

How can i add notification inside an action?

    ->actions([

          Tables\Actions\ViewAction::make(),
          TableAction::make('delete')
          ->requiresConfirmation()
          ->color('danger')
          ->icon('heroicon-s-trash')
          ->action(function (User $record) {

              Log::info($record);
              if($record->id == 1){
                  Notification::make()
                  ->success()
                  ->title('User deleted')
                  ->body('The user has been deleted successfully.');
              }else{
                  return;
              }

            }),
      ])
Was this page helpful?