From 3d91db66d05f2f226d3d64d1479fc6a5513a0793 Mon Sep 17 00:00:00 2001
From: Sam Light <sam@lightscale.co.uk>
Date: Mon, 31 Mar 2025 00:50:18 +0100
Subject: Assets testing

---
 src/Assets.php | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

(limited to 'src')

diff --git a/src/Assets.php b/src/Assets.php
index 78cbe59..a431ffb 100644
--- a/src/Assets.php
+++ b/src/Assets.php
@@ -4,19 +4,54 @@ namespace Lightscale\LaralightAssets;
 
 class Assets
 {
-    private string $manifestParser;
+    private string $defaultManifest;
     private array $manifests = [];
     private array $manifestsParsers = [];
     private array $files = [];
     private array $queuedHeadFiles = [];
     private array $queuedFooterFiles = [];
 
+    public function addManifest(
+        string $name,
+        Manifest $manifest,
+        bool $isDefault = false
+    ): void
+    {
+        $this->manifests[$name] = $manifest;
+
+        if ($isDefault) {
+            $this->defaultManifest = $name;
+        }
+    }
+
     public function registerManifest(
         string $name,
         string $path,
         string $baseUrl,
+        string $parserClass = JsonManifestParser::class,
+        bool $isDefault = false,
     ): void
     {
+        $this->addManifest(
+            $name,
+            new Manifest($path, $baseUrl, $parserClass),
+            $isDefault
+        );
+    }
 
+    public function getManifests(): array
+    {
+        return $this->manifests;
     }
+
+    public function getManifest(string $name): Manifest
+    {
+        return $this->getManifests()[$name];
+    }
+
+    public function getDefaultManifest(): Manifest
+    {
+        return $this->getManifest($this->defaultManifest);
+    }
+
 }
-- 
cgit v1.2.3