update deploy
This commit is contained in:
22
app/Actions/Faq/CreateFaqAction.php
Normal file
22
app/Actions/Faq/CreateFaqAction.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\Faq;
|
||||
|
||||
use App\DTOs\FaqData;
|
||||
use App\Events\ModelChanged;
|
||||
use App\Models\Faq;
|
||||
use App\Repositories\Contracts\FaqRepositoryInterface;
|
||||
|
||||
final class CreateFaqAction
|
||||
{
|
||||
public function __construct(private FaqRepositoryInterface $repository) {}
|
||||
|
||||
public function execute(FaqData $data): Faq
|
||||
{
|
||||
$result = $this->repository->create($data->toArray());
|
||||
|
||||
ModelChanged::dispatch(Faq::class, 'created');
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user