adrema/app/Mailgateway/Actions/UpdateAction.php

29 lines
614 B
PHP
Raw Permalink Normal View History

2023-06-08 00:00:35 +02:00
<?php
namespace App\Mailgateway\Actions;
use App\Mailgateway\Models\Mailgateway;
use Lorisleiva\Actions\ActionRequest;
use Lorisleiva\Actions\Concerns\AsAction;
class UpdateAction
{
use AsAction;
2023-06-08 00:14:55 +02:00
use ValidatesRequests;
2023-06-08 00:00:35 +02:00
/**
* @param array<string, mixed> $input
*/
public function handle(Mailgateway $mailgateway, array $input): void
{
2023-06-08 00:14:55 +02:00
$this->checkIfWorks($input);
2023-06-08 00:00:35 +02:00
$mailgateway->update($input);
}
public function asController(Mailgateway $mailgateway, ActionRequest $request): void
{
$this->handle($mailgateway, $request->validated());
}
}