Files
lucent-laravel/src/Core/Schema/FieldModule.php
T

27 lines
567 B
PHP
Raw Normal View History

2026-01-07 23:49:55 +02:00
<?php namespace Lucent\Core\Schema;
use Lucent\Core\Schema\Data\Field;
class FieldModule
{
public static function fromArray(array $data): Field
{
return new Field(
id: $data["id"],
alias: $data["alias"],
name: $data["name"],
type: $data["type"],
);
}
public static function toDb(Field $field): array
{
return [
"id" => $field->id,
"alias" => $field->alias,
"name" => $field->name,
"type" => $field->type,
];
}
}