update deploy
This commit is contained in:
22
app/Actions/Faq/UpdateFaqAction.php
Normal file
22
app/Actions/Faq/UpdateFaqAction.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 UpdateFaqAction
|
||||
{
|
||||
public function __construct(private FaqRepositoryInterface $repository) {}
|
||||
|
||||
public function execute(Faq $faq, FaqData $data): Faq
|
||||
{
|
||||
$result = $this->repository->update($faq, $data->toArray());
|
||||
|
||||
ModelChanged::dispatch(Faq::class, 'updated');
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user