2023-06-15 00:08:01 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Maildispatcher\Actions;
|
|
|
|
|
|
|
|
use App\Maildispatcher\Models\Maildispatcher;
|
|
|
|
use Illuminate\Http\RedirectResponse;
|
|
|
|
use Lorisleiva\Actions\Concerns\AsAction;
|
|
|
|
|
|
|
|
class DestroyAction
|
|
|
|
{
|
|
|
|
use AsAction;
|
|
|
|
|
|
|
|
public function handle(Maildispatcher $maildispatcher): void
|
|
|
|
{
|
2023-07-17 17:08:07 +02:00
|
|
|
$maildispatcher->gateway->type->deleteList($maildispatcher->name, $maildispatcher->gateway->domain);
|
2023-06-15 00:08:01 +02:00
|
|
|
$maildispatcher->delete();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function asController(Maildispatcher $maildispatcher): RedirectResponse
|
|
|
|
{
|
|
|
|
$this->handle($maildispatcher);
|
|
|
|
|
|
|
|
return redirect()->back();
|
|
|
|
}
|
|
|
|
}
|