getExtension() !== "json") { continue; } $schemaJson = file_get_contents($configDir . "/" . $file->getFilename()); $schema = json_decode($schemaJson, true); if (empty($schema)) { $this->error("Invalid JSON " . $file->getFilename()); return 0; } $schemas[] = $schema; } $schemas = collect($schemas)->sortBy("label")->values()->toArray(); if(!file_exists(storage_path("lucent"))){ mkdir(storage_path("lucent")); } file_put_contents(schemas_path(), json_encode($schemas)); $this->info("Lucent Schemas were updated"); } }