{"id":20012303,"url":"https://github.com/archtechx/virtualcolumn","last_synced_at":"2025-05-16T04:05:37.281Z","repository":{"id":44745649,"uuid":"277534395","full_name":"archtechx/virtualcolumn","owner":"archtechx","description":"Eloquent Virtual Column package.","archived":false,"fork":false,"pushed_at":"2025-02-25T13:13:18.000Z","size":50,"stargazers_count":77,"open_issues_count":2,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-11T06:16:09.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/archtechx.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":"2020-07-06T12:22:12.000Z","updated_at":"2025-05-03T14:28:46.000Z","dependencies_parsed_at":"2023-11-07T03:09:36.348Z","dependency_job_id":"afec1868-99c5-4479-8724-6378125fdf76","html_url":"https://github.com/archtechx/virtualcolumn","commit_stats":{"total_commits":20,"total_committers":7,"mean_commits":2.857142857142857,"dds":0.6,"last_synced_commit":"0b108903b51711ff9f0357458dc3eb03398eb894"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archtechx%2Fvirtualcolumn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archtechx%2Fvirtualcolumn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archtechx%2Fvirtualcolumn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/archtechx%2Fvirtualcolumn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/archtechx","download_url":"https://codeload.github.com/archtechx/virtualcolumn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464895,"owners_count":22075570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-13T07:29:40.574Z","updated_at":"2025-05-16T04:05:33.309Z","avatar_url":"https://github.com/archtechx.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eloquent Virtual Column\n\n## Installation\n\nSupports Laravel 10, 11, and 12.\n\n```\ncomposer require stancl/virtualcolumn\n```\n\n## Usage\n\nUse the `VirtualColumn` trait on your model:\n```php\nuse Illuminate\\Database\\Eloquent\\Model;\nuse Stancl\\VirtualColumn\\VirtualColumn;\n\nclass MyModel extends Model\n{\n    use VirtualColumn;\n\n    public $guarded = [];\n\n    public static function getCustomColumns(): array\n    {\n        return [\n            'id',\n            'custom1',\n            'custom2',\n        ];\n    }\n}\n```\n\nCreate a migration:\n```php\npublic function up()\n{\n    Schema::create('my_models', function (Blueprint $table) {\n        $table-\u003eincrements('id');\n\n        $table-\u003estring('custom1')-\u003enullable();\n        $table-\u003estring('custom2')-\u003enullable();\n\n        $table-\u003ejson('data');\n    });\n}\n```\n\nAnd store any data on your model:\n\n```php\n$myModel = MyModel::create(['foo' =\u003e 'bar']);\n$myModel-\u003eupdate(['foo' =\u003e 'baz']);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchtechx%2Fvirtualcolumn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farchtechx%2Fvirtualcolumn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farchtechx%2Fvirtualcolumn/lists"}