{"id":21959991,"url":"https://github.com/jdion84/lucid","last_synced_at":"2026-05-04T09:31:26.071Z","repository":{"id":227977920,"uuid":"758292293","full_name":"jdion84/lucid","owner":"jdion84","description":"Declare database schemas inside Laravel models.","archived":false,"fork":false,"pushed_at":"2024-02-16T02:04:44.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-09T06:40:30.777Z","etag":null,"topics":["database","laravel","lucid","models","schemas"],"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/jdion84.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","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}},"created_at":"2024-02-16T02:04:19.000Z","updated_at":"2024-02-16T02:04:58.000Z","dependencies_parsed_at":"2024-03-22T11:50:13.406Z","dependency_job_id":null,"html_url":"https://github.com/jdion84/lucid","commit_stats":null,"previous_names":["jdion84/lucid"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jdion84/lucid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdion84%2Flucid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdion84%2Flucid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdion84%2Flucid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdion84%2Flucid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdion84","download_url":"https://codeload.github.com/jdion84/lucid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdion84%2Flucid/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32601483,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["database","laravel","lucid","models","schemas"],"created_at":"2024-11-29T09:36:46.257Z","updated_at":"2026-05-04T09:31:26.038Z","avatar_url":"https://github.com/jdion84.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lucid\n\nDeclare database schemas inside Laravel models.\n\n## Installation\n\nRequire this package via composer:\n\n```console\ncomposer require jdion84/lucid\n```\n\n## Usage\n\nCreate a new model class with a schema method:\n\n```console\nphp artisan make:schema Post\n```\n\nOr, add a schema method to an existing model:\n\n```php\nnamespace App\\Models;\n\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\nuse Illuminate\\Database\\Eloquent\\Model;\nuse Jdion84\\Lucid\\Table;\n\nclass Post extends Model\n{\n    use HasFactory;\n\n    public function schema(Table $table)\n    {\n        $table-\u003eid();\n        $table-\u003estring('title')-\u003eindex();\n        $table-\u003etext('body');\n        $table-\u003etimestamp('created_at');\n        $table-\u003etimestamp('updated_at');\n    }\n}\n```\n\nMigrate \u0026 sync model schema methods with the database:\n\n```console\nphp artisan migrate:schemas\n```\n\n## Commands\n\nCreate a new model class with a schema method:\n\n```console\nphp artisan make:schema {name} {--p|pivot} {--force}\n```\n\nMigrate \u0026 sync model schema methods with the database:\n\n```console\nmigrate:schemas {--f|fresh} {--s|seed} {--force}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdion84%2Flucid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdion84%2Flucid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdion84%2Flucid/lists"}