fixing multiple references

This commit is contained in:
2024-08-27 12:24:51 +03:00
parent ffc39f078d
commit 82174afdea
23 changed files with 114 additions and 1000 deletions
+3 -9
View File
@@ -16,19 +16,13 @@ class CompileSchemas extends Command
protected $description = 'Compiles schemas';
public function __construct(
public SchemaService $schemaService
)
public function handle(SchemaService $schemaService)
{
parent::__construct();
}
public function handle()
{
$configDir = base_path(config('lucent.schemas_path'));
$schemasDirIterator = new DirectoryIterator($configDir);
$schemas = [];
foreach ($schemasDirIterator as $file) {
if ($file->getExtension() !== "json") {
continue;
@@ -46,7 +40,7 @@ class CompileSchemas extends Command
$schemas = collect($schemas)->sortBy("label")->values();
$roles = $schemas
->map([$this->schemaService, 'fromArray'])
->map([$schemaService, 'fromArray'])
->whereIn("type", [Type::COLLECTION, Type::FILES])
->reduce(fn($carry, Schema $schema) => array_merge(
$carry,