This commit is contained in:
2023-10-04 13:32:30 +03:00
parent 215d238505
commit 1ca5f4e521
82 changed files with 519 additions and 1889 deletions
+5 -5
View File
@@ -8,7 +8,7 @@ use Illuminate\Console\Command;
class CompileConfig extends Command
{
protected $signature = 'lucent:compile:config {path}';
protected $signature = 'lucent:config';
protected $description = 'Compiles Config';
@@ -21,18 +21,18 @@ class CompileConfig extends Command
public function handle()
{
$configDir = base_path($this->argument('path'));
$configDir = base_path(config('lucent.config_path'));
$configJson = file_get_contents($configDir . "lucent.json");
$configJson = file_get_contents($configDir . "/lucent.json");
$config = json_decode($configJson, true);
$schemasDirIterator = new DirectoryIterator($configDir . "Schemas");
$schemasDirIterator = new DirectoryIterator($configDir . "/Schemas");
$schemas = [];
foreach ($schemasDirIterator as $file) {
if ($file->getExtension() !== "json") {
continue;
}
$schemaJson = file_get_contents($configDir . "Schemas/" . $file->getFilename());
$schemaJson = file_get_contents($configDir . "/Schemas/" . $file->getFilename());
$schema = json_decode($schemaJson, true);
if (empty($schema)) {
$this->error("Invalid JSON " . $file->getFilename());