restore set creation

This commit is contained in:
Yisroel Baum 2026-05-25 08:37:07 +03:00
parent 4897cc2e20
commit 8ec7af8a1f
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
3 changed files with 21 additions and 0 deletions

View file

@ -0,0 +1,10 @@
<?php
namespace App\Set;
class CreateSetDto
{
public function __construct(
public string $name,
) {}
}

View file

@ -4,6 +4,15 @@ namespace App\Set;
class EloquentSetRepository implements SetRepository
{
public function create(CreateSetDto $dto): Set
{
$model = SetModel::create([
'name' => $dto->name,
]);
return $this->toDomain($model);
}
public function find(int $id): ?Set
{
$model = SetModel::find($id);

View file

@ -4,6 +4,8 @@ namespace App\Set;
interface SetRepository
{
public function create(CreateSetDto $dto): Set;
public function find(int $id): ?Set;
/**