argument('name'); $schema = new CollectionSchema( name: $name, label: $name, visible: [], groups: [], fields: Collection::make(), ); $json = json_encode($schema, JSON_PRETTY_PRINT); $configDir = base_path(config('lucent.schemas_path')); if(!file_exists($configDir)) { $this->error("Your config directory \"$configDir\" doesn't exist. Create it first and run again"); return; } $schemaPath = $configDir . "/" . $name . '.json'; if(file_exists($schemaPath)){ $this->error("The schema file already exists."); return 0; } file_put_contents($schemaPath, $json); $this->info("The schema file has been created."); } }