ldc-boutique-cnc-sable/app/Actions/Pages/UpdatePageInput.php

27 lines
631 B
PHP

<?php
declare(strict_types=1);
namespace App\Actions\Pages;
use App\Contracts\ActionInput;
use App\Models\Page;
use Domain\Models\ValueObjects\SeoMetadata;
use Webmozart\Assert\Assert;
final readonly class UpdatePageInput implements ActionInput
{
public function __construct(
public Page $page,
public SeoMetadata $seo,
public ?string $title,
public string $content,
) {
Assert::stringNotEmpty(trim($this->content));
if ($this->title !== null) {
Assert::stringNotEmpty(trim($this->title));
Assert::maxLength($this->title, 255);
}
}
}