{"id":25433368,"url":"https://github.com/suwi-lanji/configurator","last_synced_at":"2026-04-08T18:31:19.363Z","repository":{"id":277864755,"uuid":"933731681","full_name":"suwi-lanji/configurator","owner":"suwi-lanji","description":"Create Laravel eloquent migrations from YAML configuration","archived":false,"fork":false,"pushed_at":"2025-02-16T16:46:59.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-14T18:07:48.808Z","etag":null,"topics":["eloquent","json","laravel","migrations","open-source","php","ruby","yaml"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suwi-lanji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-16T15:13:01.000Z","updated_at":"2025-02-17T11:31:43.000Z","dependencies_parsed_at":"2025-02-16T17:50:12.492Z","dependency_job_id":null,"html_url":"https://github.com/suwi-lanji/configurator","commit_stats":null,"previous_names":["suwi-lanji/configurator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suwi-lanji/configurator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suwi-lanji%2Fconfigurator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suwi-lanji%2Fconfigurator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suwi-lanji%2Fconfigurator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suwi-lanji%2Fconfigurator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suwi-lanji","download_url":"https://codeload.github.com/suwi-lanji/configurator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suwi-lanji%2Fconfigurator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31568579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eloquent","json","laravel","migrations","open-source","php","ruby","yaml"],"created_at":"2025-02-17T05:19:24.063Z","updated_at":"2026-04-08T18:31:19.341Z","avatar_url":"https://github.com/suwi-lanji.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Configurator\n\n### Available for hire email | suwilanjichipofya@outlook.com . Linked In Suwilanji Chipofya\n\n**Configurator** is a command-line tool that generates Laravel Eloquent migrations from YAML or JSON configuration files. It simplifies the process of defining database schemas and automates the creation of migration files for Laravel applications.\n\n---\n\n## Features\n\n- **Supports Multiple Formats**: Works with YAML and JSON configuration files.\n- **Customizable**: Define table names, columns, data types, and constraints in a simple configuration file.\n- **Scalable**: Generates migrations for multiple tables and relationships.\n- **Error Handling**: Provides clear warnings and skips invalid configurations.\n\n---\n\n## Installation\n\n### 1. Install Ruby\n\nEnsure you have Ruby installed on your system. You can check your Ruby version by running:\n\n```bash\nruby -v\n```\n\nIf Ruby is not installed, follow the official [Ruby installation guide](https://www.ruby-lang.org/en/documentation/installation/).\n\n### 2. Install the Gem\n\nYou can install the `configurator` gem directly from the source:\n\n```bash\ngem install config-to-laravel-migrations\n```\n\nAlternatively, clone the repository and build the gem locally:\n\n```bash\ngit clone https://github.com/suwi-lanji/configurator.git\ncd configurator\ngem build configurator.gemspec\ngem install configurator-1.0.0.gem\n```\n\n---\n\n## Usage\n\n### 1. Create a Configuration File\n\nDefine your database schema in a YAML or JSON file. Here’s an example `school_managementsystem.yml` file:\n\n```yaml\nUser:\n  table_name: users\n  attributes:\n    user_id: { type: int, primary_key: true }\n    username: { type: string, unique: true }\n    password_hash: { type: string }\n    email: { type: string, unique: true }\n    role_id: { type: int, foreign_key: roles.role_id }\n    institution_id: { type: int, foreign_key: institutions.institution_id }\n\nRole:\n  table_name: roles\n  attributes:\n    role_id: { type: int, primary_key: true }\n    role_name: { type: string, unique: true }\n```\n\n### 2. Generate Migrations\n\nRun the `configurator` command with your configuration file:\n\n```bash\nconfigurator generate school_managementsystem.yml migrations\n```\n\nThis will generate Laravel migration files in the `migrations` directory.\n\n---\n\n## Example Output\n\nFor the above configuration, the tool will generate the following files:\n\n#### `migrations/20250210120000_create_users_table.php`\n\n```php\n\u003c?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateUserTable extends Migration\n{\n    public function up()\n    {\n        Schema::create('users', function (Blueprint $table) {\n            $table-\u003eid();\n            $table-\u003einteger('user_id');\n            $table-\u003estring('username')-\u003eunique();\n            $table-\u003estring('password_hash');\n            $table-\u003estring('email')-\u003eunique();\n            $table-\u003einteger('role_id');\n            $table-\u003eforeignId('institution_id');\n            $table-\u003etimestamps();\n        });\n    }\n\n    public function down()\n    {\n        Schema::dropIfExists('users');\n    }\n}\n```\n\n#### `migrations/20250210120001_create_roles_table.php`\n\n```php\n\u003c?php\n\nuse Illuminate\\Database\\Migrations\\Migration;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Support\\Facades\\Schema;\n\nclass CreateRoleTable extends Migration\n{\n    public function up()\n    {\n        Schema::create('roles', function (Blueprint $table) {\n            $table-\u003eid();\n            $table-\u003einteger('role_id');\n            $table-\u003estring('role_name')-\u003eunique();\n            $table-\u003etimestamps();\n        });\n    }\n\n    public function down()\n    {\n        Schema::dropIfExists('roles');\n    }\n}\n```\n\n---\n\n## Configuration File Format\n\n### YAML Format\n\n```yaml\nModelName:\n  table_name: table_name\n  attributes:\n    column_name:\n      type: data_type\n      primary_key: true/false\n      unique: true/false\n      foreign_key: referenced_table.referenced_column\n```\n\n### JSON Format\n\n```json\n{\n  \"ModelName\": {\n    \"table_name\": \"table_name\",\n    \"attributes\": {\n      \"column_name\": {\n        \"type\": \"data_type\",\n        \"primary_key\": true/false,\n        \"unique\": true/false,\n        \"foreign_key\": \"referenced_table.referenced_column\"\n      }\n    }\n  }\n}\n```\n\n---\n\n## Supported Data Types\n\nThe following data types are supported:\n\n- `int` → `integer`\n- `string` → `string`\n- `date` → `date`\n- `datetime` → `datetime`\n- `float` → `float`\n- `enum` → `enum`\n\n---\n\n## Contributing\n\nContributions are welcome! Follow these steps to contribute:\n\n1. Fork the repository.\n2. Create a new branch for your feature or bugfix.\n3. Commit your changes and push to the branch.\n4. Submit a pull request.\n\n---\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n---\n\n## Support\n\nIf you encounter any issues or have questions, please open an issue on the [GitHub repository](https://github.com/suwi-lanji/configurator/issues).\n\n---\n\n## Author\n\n- **Suwilanji Jack Chipofya**  \n  GitHub: [suwi-lanji](https://github.com/suwi-lanji)  \n  Email: suwilanjichipofya@outlook.com\n\n---\n\nEnjoy using **Configurator**! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuwi-lanji%2Fconfigurator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuwi-lanji%2Fconfigurator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuwi-lanji%2Fconfigurator/lists"}