schemas and fields

This commit is contained in:
2026-01-07 23:49:55 +02:00
parent 874ddd33e2
commit 53f9548966
17 changed files with 573 additions and 240 deletions
+27
View File
@@ -0,0 +1,27 @@
<?php namespace Lucent\Core\Repository;
use Illuminate\Support\Facades\DB;
use Lucent\Core\Schema\Data\Schema;
use Lucent\Core\Schema\SchemaModule;
class SchemaRepo
{
const TABLE_NAME = "schemas";
/**
* @@return Schema[]
*/
public static function all(): array
{
return DB::table(self::TABLE_NAME)
->orderBy("name")
->get()
->map(SchemaModule::fromDb(...))
->toArray();
}
public static function insert(Schema $schema): void
{
DB::table(self::TABLE_NAME)->insert(SchemaModule::toDb($schema));
}
}