From 7e4961f3d801f777e6b69f6358cbab0370226522 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Mon, 14 Aug 2023 23:48:38 +0200 Subject: [PATCH] Update DeleteJob as Action --- app/Member/DeleteJob.php | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/app/Member/DeleteJob.php b/app/Member/DeleteJob.php index 2325c852..25f5f32b 100644 --- a/app/Member/DeleteJob.php +++ b/app/Member/DeleteJob.php @@ -2,34 +2,16 @@ namespace App\Member; +use App\Lib\Data\JobMiddleware\SendsMessages; use App\Setting\NamiSettings; -use Illuminate\Bus\Queueable; -use Illuminate\Contracts\Queue\ShouldQueue; -use Illuminate\Foundation\Bus\Dispatchable; -use Illuminate\Queue\InteractsWithQueue; -use Illuminate\Queue\SerializesModels; +use Lorisleiva\Actions\Concerns\AsAction; -class DeleteJob implements ShouldQueue +class DeleteJob { - use Dispatchable; - use InteractsWithQueue; - use Queueable; - use SerializesModels; + use AsAction; - public int $namiId; - - public function __construct(int $namiId) + public function handle(int $namiId) { - $this->namiId = $namiId; - } - - /** - * Execute the job. - * - * @return void - */ - public function handle(NamiSettings $setting) - { - $setting->login()->deleteMember($this->namiId); + app(NamiSettings::class)->login()->deleteMember($namiId); } }