Pass template to our component rendering to avoid duplicate javascript object id's

This commit is contained in:
2025-06-15 13:27:27 +10:00
parent acf19cdc5b
commit 6059bc1e45
17 changed files with 23 additions and 25 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Classes;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
class Template
{
@@ -30,6 +31,7 @@ class Template
public function __get(string $key): mixed
{
return match ($key) {
'name' => Str::replaceEnd('.json','',$this->file),
'attributes' => collect(array_map('strtolower',array_keys(Arr::get($this->template,$key)))),
'objectclasses' => collect(array_map('strtolower',Arr::get($this->template,$key))),
'enabled' => Arr::get($this->template,$key,FALSE) && (! $this->invalid),