-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{/if}
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..2713515
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,6 @@
+{
+ "name": "lucent-package",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {}
+}
diff --git a/src/Graph/Record/Contracts/NewDocumentData.php b/src/Graph/Record/Contracts/NewDocumentData.php
index 47eb48a..838f6e7 100644
--- a/src/Graph/Record/Contracts/NewDocumentData.php
+++ b/src/Graph/Record/Contracts/NewDocumentData.php
@@ -4,7 +4,7 @@ namespace Lucent\Graph\Record\Contracts;
use Lucent\Graph\Record\Status;
use Lucent\Support\Collection;
-use PhpOption\Option;
+use Lucent\Support\Option\Option;
class NewDocumentData
{
@@ -18,7 +18,7 @@ class NewDocumentData
public function __construct(
public string $schemaName,
public array $data,
- public Option $id,
+ public Option $id,
public Collection $edges,
public Status $status = Status::DRAFT,
)
diff --git a/src/Http/Controller/RecordController.php b/src/Http/Controller/RecordController.php
index a0d7fa7..5a1d185 100644
--- a/src/Http/Controller/RecordController.php
+++ b/src/Http/Controller/RecordController.php
@@ -320,7 +320,6 @@ class RecordController extends Controller
field: $item["field"],
data: Option::fromValue(data_get($item, "data")),
));
-
$res = match ($request->input("isCreateMode")) {
true => $this->recordService->createDocument(new NewDocumentData(
schemaName: $request->input("schemaName"),
diff --git a/src/Schema/Sidebar/SidebarService.php b/src/Schema/Sidebar/SidebarService.php
index 2734052..c5109dc 100644
--- a/src/Schema/Sidebar/SidebarService.php
+++ b/src/Schema/Sidebar/SidebarService.php
@@ -44,13 +44,13 @@ class SidebarService
);
})->toArray();
- $usedSchemaNames =$sidebar->get()->sections->reduce(fn(array $carry, Section $section) => array_merge($carry, $section->items->pluck("schema")->toArray()), []);
+ $usedSchemaNames = $sidebar->get()->sections->reduce(fn(array $carry, Section $section) => array_merge($carry, $section->items->pluck("schema")->toArray()), []);
}
$sections[] = new SectionData(
label: $sidebar->isDefined() ? "Rest" : "Content",
- isOpen: $schemas->whereNotIn("name",$usedSchemaNames)->where("name",$currentSchema)->isNotEmpty(),
- items: array_map(fn($item) => $this->renderItem($currentSchema, $item), $schemas->whereNotIn("name",$usedSchemaNames)->toArray())
+ isOpen: $schemas->whereNotIn("name", $usedSchemaNames)->where("name", $currentSchema)->isNotEmpty(),
+ items: array_map(fn($item) => $this->renderItem($currentSchema, $item), $schemas->whereNotIn("name", $usedSchemaNames)->toArray())
);
return view('lucent::sidebar.sidebar', [
@@ -61,6 +61,7 @@ class SidebarService
private function renderItem(string $currentSchema, Item|Schema $item): ItemData
{
+
return match (get_class($item)) {
LinkItem::class => new ItemData($item->label, $item->href, false, true),
SchemaItem::class => new ItemData($item->label, $this->channelService->channel->lucentUrl . "/content/" . $item->schema, $currentSchema === $item->schema, false),