update deploy
This commit is contained in:
21
app/Actions/Comment/DeleteCommentAction.php
Normal file
21
app/Actions/Comment/DeleteCommentAction.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\Comment;
|
||||
|
||||
use App\Events\ModelChanged;
|
||||
use App\Models\Comment;
|
||||
use App\Repositories\Contracts\CommentRepositoryInterface;
|
||||
|
||||
final class DeleteCommentAction
|
||||
{
|
||||
public function __construct(private CommentRepositoryInterface $repository) {}
|
||||
|
||||
public function execute(Comment $comment): bool
|
||||
{
|
||||
$this->repository->delete($comment);
|
||||
|
||||
ModelChanged::dispatch(Comment::class, 'deleted');
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user