This commit is contained in:
2023-10-02 23:10:49 +03:00
commit c6cb488379
255 changed files with 18731 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php
namespace Lucent\Channel;
use Lucent\Validator\Validator;
class PreviewTarget
{
function __construct(
public readonly string $label,
public readonly string $url,
)
{
Validator::single("label", $label, "required|min:2|max:50");
Validator::single("url", $url, "required|url");
}
public static function fromArray(array $data): PreviewTarget
{
return new PreviewTarget(
label: $data["label"],
url: $data["url"],
);
}
}