{"id":21544341,"url":"https://github.com/railken/eloquent-instance","last_synced_at":"2026-05-21T05:02:31.313Z","repository":{"id":62532812,"uuid":"241100585","full_name":"railken/eloquent-instance","owner":"railken","description":"A simple trait that enables the use of instance of Model in your relationships","archived":false,"fork":false,"pushed_at":"2024-03-27T18:40:58.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T12:18:17.435Z","etag":null,"topics":["dynamic","eloquent","instance","laravel","relationships"],"latest_commit_sha":null,"homepage":"","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/railken.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-02-17T12:19:56.000Z","updated_at":"2024-03-27T18:38:27.000Z","dependencies_parsed_at":"2024-11-24T05:17:51.407Z","dependency_job_id":"20119e7c-86f2-451a-9570-66281793330b","html_url":"https://github.com/railken/eloquent-instance","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/railken/eloquent-instance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railken%2Feloquent-instance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railken%2Feloquent-instance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railken%2Feloquent-instance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railken%2Feloquent-instance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/railken","download_url":"https://codeload.github.com/railken/eloquent-instance/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railken%2Feloquent-instance/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259340515,"owners_count":22843007,"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":["dynamic","eloquent","instance","laravel","relationships"],"created_at":"2024-11-24T05:17:43.517Z","updated_at":"2026-05-21T05:02:26.269Z","avatar_url":"https://github.com/railken.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"left\"\u003eEloquent Instance\u003c/h1\u003e\n\n[![Actions Status](https://github.com/railken/eloquent-instance/workflows/Test/badge.svg)](https://github.com/railken/eloquent-instance/actions)\n\nA simple trait that enables the use of instance of `Model` in your relationships. Why? Because otherwise it would be impossible to relate two models that doesn't exist in the code, but only as instances (e.g. stored in db)\n\n## Requirements\n\nPHP 7.2 and laravel 5.8\n\n## Installation\n\nYou can install it via [Composer](https://getcomposer.org/) by typing the following command:\n\n```bash\ncomposer require railken/eloquent-instance\n```\n\n\n## Usage\n\nSimple include `Railken\\EloquentInstance\\HasRelationships` in your model and start using \n\n```php\n\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Model;\nuse Railken\\EloquentInstance\\HasRelationships;\n\nclass Author extends Model\n{\n    use HasRelationships;\n    \n    public function books()\n    {\n        $book = new Book();\n        $book-\u003esetTable('book_custom');\n\n        return $this-\u003ehasMany($book);\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frailken%2Feloquent-instance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frailken%2Feloquent-instance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frailken%2Feloquent-instance/lists"}