{"id":19450887,"url":"https://github.com/morning-train/wp-database","last_synced_at":"2026-02-26T08:38:58.769Z","repository":{"id":64719126,"uuid":"577354113","full_name":"Morning-Train/wp-database","owner":"Morning-Train","description":"Database with Illuminate Models, Eloquent and migrations","archived":false,"fork":false,"pushed_at":"2023-11-09T11:00:09.000Z","size":55,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-18T00:06:07.902Z","etag":null,"topics":["database","eloquent","php","wordpress","wp"],"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/Morning-Train.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":"2022-12-12T14:53:24.000Z","updated_at":"2024-03-05T10:38:10.000Z","dependencies_parsed_at":"2023-11-09T12:28:21.552Z","dependency_job_id":"cb40beaf-ed7f-4bad-a783-9a1d77084d36","html_url":"https://github.com/Morning-Train/wp-database","commit_stats":{"total_commits":38,"total_committers":4,"mean_commits":9.5,"dds":0.5,"last_synced_commit":"d5b42fc57b35a4e42e51af7e813505550a63e2df"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morning-Train%2Fwp-database","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morning-Train%2Fwp-database/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morning-Train%2Fwp-database/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morning-Train%2Fwp-database/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Morning-Train","download_url":"https://codeload.github.com/Morning-Train/wp-database/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250748107,"owners_count":21480778,"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":["database","eloquent","php","wordpress","wp"],"created_at":"2024-11-10T16:39:21.672Z","updated_at":"2026-02-26T08:38:58.730Z","avatar_url":"https://github.com/Morning-Train.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Morningtrain\\WP\\Database\n\nA Morningtrain package that implements Laravel Eloquent and Migrations into WordPress.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Getting Started](#getting-started)\n    - [Installation](#installation)\n- [Dependencies](#dependencies)\n    - [illuminate/database](#illuminatedatabase)\n- [Usage](#usage)\n  - [Initializing package](#initializing-package)\n  - [Creating a Model](#creating-a-model)\n  - [Creating a Migration](#creating-a-migration)\n  - [Running migrations](#running-migrations)\n- [Credits](#credits)\n- [Testing](#testing)\n- [License](#license)\n\n## Introduction\n\n## Getting Started\n\nTo get started install the package as described below in [Installation](#installation).\n\nTo use the tool have a look at [Usage](#usage)\n\n### Installation\n\nInstall with composer\n\n```bash\ncomposer require morningtrain/wp-database\n```\n\n## Dependencies\n\n### illuminate/database\n\n[Database](https://laravel.com/docs/database)\n\n## Usage\n\n### Initializing package\n\n```php\n\u003c?php\n    Database::setup(__DIR__ . \"/database/migrations\");\n```\n\nIf you want to use migrations from multiple directories you can do, by calling the setup method multiple times.\n\n### Creating a Model\n\nIn `app/Models`\n\n```php\n// Foo.php\n\u003c?php\n\n    namespace MyProject\\App\\Models;\n\n    /**\n     * @property int $id\n     * @property string $title\n     */\n    class Foo extends \\Illuminate\\Database\\Eloquent\\Model\n    {\n        public $timestamps = false;\n        protected $table = 'foo';\n    }\n```\n\n### Creating a Migration\n\n```shell\nwp make:migration create_foo_table\n```\n\nIf there is multiple migration paths, you will be asked to choose one.  \nWill create a new migration file for you with `Schema::create('foo')` already prepared.\n\n### Running migrations\n\nYou can run all new migrations like so:\n\nUsing `wp cli`:\n\n```shell\nwp dbmigrate\n```\n\nUsing `php`:\n\n```php\n\u003c?php\n    \\Morningtrain\\WP\\Database\\Database::migrate();\n?\u003e\n```\n\n## Credits\n\n- [Mathias Munk](https://github.com/mrmoeg)\n- [Martin Schadegg Brønniche](https://github.com/mschadegg)\n- [All Contributors](../../contributors)\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorning-train%2Fwp-database","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorning-train%2Fwp-database","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorning-train%2Fwp-database/lists"}