From c38bd547928961db573644774f26a8350f4f7eb7 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 18 Jul 2024 23:06:57 -0600 Subject: [PATCH] Add Delete Remote Profile command --- app/Console/Commands/DeleteRemoteProfile.php | 50 ++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 app/Console/Commands/DeleteRemoteProfile.php diff --git a/app/Console/Commands/DeleteRemoteProfile.php b/app/Console/Commands/DeleteRemoteProfile.php new file mode 100644 index 000000000..09708f7e8 --- /dev/null +++ b/app/Console/Commands/DeleteRemoteProfile.php @@ -0,0 +1,50 @@ + strlen($value) > 2 + ? Profile::whereNotNull('domain')->where('username', 'like', $value . '%')->pluck('username', 'id')->all() + : [] + ); + $profile = Profile::whereNotNull('domain')->find($id); + + if(!$profile) { + $this->error('Could not find profile.'); + exit; + } + + $confirmed = confirm('Are you sure you want to delete ' . $profile->username . '\'s account? This action cannot be reversed.'); + DeleteRemoteProfilePipeline::dispatch($profile)->onQueue('delete'); + $this->info('Dispatched delete job, it may take a few minutes...'); + exit; + } +}