Added the ability to add project information.

This commit is contained in:
2024-04-14 15:27:51 +05:00
parent b7d0a2453e
commit 2769585de0
35 changed files with 862 additions and 14 deletions

View File

@@ -0,0 +1,27 @@
<?php declare(strict_types=1);
namespace App\Services\ProjectContent;
use App\Models\ProjectContent;
final readonly class ProjectContentCommandHandler
{
public function handleStore(int $projectId, int $languageId, array $data): ProjectContent
{
$content = new ProjectContent();
$content->project_id = $projectId;
$content->language_id = $languageId;
$content->fill($data);
$content->save();
return $content;
}
public function handleUpdate(ProjectContent $content, array $data): ProjectContent
{
$content->update($data);
return $content;
}
}