Files
lucent-laravel/src/Schema/BlockUi/Markdown.php
T
2024-03-19 23:05:57 +02:00

37 lines
819 B
PHP

<?php
namespace Lucent\Schema\BlockUi;
use Lucent\Schema\FieldInfo;
use Lucent\Schema\FieldInterface;
use Lucent\Schema\FieldType;
use Lucent\Schema\Nullable;
use Lucent\Schema\Validator\RequiredInterface;
class Markdown implements FieldInterface
{
public FieldInfo $info;
public function __construct(
public string $name,
public string $label,
public ?int $min = null,
public ?int $max = null,
public string $default = "",
)
{
$this->info = new FieldInfo("markdown", "Markdown Editor", FieldType::STRING);
}
public function format(array $input, array $output): array
{
$output[$this->name] = $input[$this->name] ?? "";
return $output;
}
public function isRequired(): bool
{
return false;
}
}