22 lines
427 B
PHP
22 lines
427 B
PHP
<?php
|
|
|
|
namespace App\Actions\Faq;
|
|
|
|
use App\Events\ModelChanged;
|
|
use App\Models\Faq;
|
|
use App\Repositories\Contracts\FaqRepositoryInterface;
|
|
|
|
final class DeleteFaqAction
|
|
{
|
|
public function __construct(private FaqRepositoryInterface $repository) {}
|
|
|
|
public function execute(Faq $faq): bool
|
|
{
|
|
$this->repository->delete($faq);
|
|
|
|
ModelChanged::dispatch(Faq::class, 'deleted');
|
|
|
|
return true;
|
|
}
|
|
}
|