Update DeleteJob as Action
This commit is contained in:
parent
2d9f79ee15
commit
7e4961f3d8
|
@ -2,34 +2,16 @@
|
||||||
|
|
||||||
namespace App\Member;
|
namespace App\Member;
|
||||||
|
|
||||||
|
use App\Lib\Data\JobMiddleware\SendsMessages;
|
||||||
use App\Setting\NamiSettings;
|
use App\Setting\NamiSettings;
|
||||||
use Illuminate\Bus\Queueable;
|
use Lorisleiva\Actions\Concerns\AsAction;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
|
||||||
use Illuminate\Queue\SerializesModels;
|
|
||||||
|
|
||||||
class DeleteJob implements ShouldQueue
|
class DeleteJob
|
||||||
{
|
{
|
||||||
use Dispatchable;
|
use AsAction;
|
||||||
use InteractsWithQueue;
|
|
||||||
use Queueable;
|
|
||||||
use SerializesModels;
|
|
||||||
|
|
||||||
public int $namiId;
|
public function handle(int $namiId)
|
||||||
|
|
||||||
public function __construct(int $namiId)
|
|
||||||
{
|
{
|
||||||
$this->namiId = $namiId;
|
app(NamiSettings::class)->login()->deleteMember($namiId);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute the job.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function handle(NamiSettings $setting)
|
|
||||||
{
|
|
||||||
$setting->login()->deleteMember($this->namiId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue