adrema/app/Mailgateway/Actions/StoreAction.php

28 lines
545 B
PHP
Raw Permalink Normal View History

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