update deploy

This commit is contained in:
bulut
2026-03-27 10:41:54 +03:00
parent 69d19c0176
commit 6f6448aa06
422 changed files with 37956 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Actions\Comment;
use App\DTOs\CommentData;
use App\Events\ModelChanged;
use App\Models\Comment;
use App\Repositories\Contracts\CommentRepositoryInterface;
final class CreateCommentAction
{
public function __construct(private CommentRepositoryInterface $repository) {}
public function execute(CommentData $data): Comment
{
$result = $this->repository->create($data->toArray());
ModelChanged::dispatch(Comment::class, 'created');
return $result;
}
}

View 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;
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace App\Actions\Comment;
use App\Events\ModelChanged;
use App\Models\Comment;
use App\Repositories\Contracts\CommentRepositoryInterface;
final class UpdateCommentAction
{
public function __construct(private CommentRepositoryInterface $repository) {}
/**
* @param array<string, mixed> $data
*/
public function execute(Comment $comment, array $data): Comment
{
$result = $this->repository->update($comment, $data);
ModelChanged::dispatch(Comment::class, 'updated');
return $result;
}
}