[!IMPORTANT] The phinx package will be removed in a future release in order to use the Laravel migration system. It is therefore advisable to stop using the tool. More info.
WordPress ORM with Eloquent is a small library that adds a basic ORM into WordPress, which is easily extendable and includes models for core WordPress models such as posts, post metas, users, comments and more.
The ORM is based on Eloquent ORM and uses the WordPress connection (wpdb
class).
💡 To simplify the integration of this library, we recommend using WordPress with one of the following tools: Bedrock, Themosis or Wordplate.
Comment
, Option
, Post
, TermTaxonomy
, Term
, User
, PostMeta
and UserMeta
Article
, Attachment
and Page
wpdb
class), no configuration required !Not yet developed but planned in a future version:
This documentation only covers the specific points of this library, if you want to know more about Eloquent, the easiest is to look at the documentation of Eloquent :)
Requirements
The server requirements are basically the same as for WordPress with the addition of a few ones :
Installation
You can use Composer. Follow the installation instructions if you do not already have composer installed.
composer require dbout/wp-orm
In your PHP script, make sure you include the autoloader:
require __DIR__ . '/vendor/autoload.php';
🎉 You have nothing more to do, you can use the library now! Not even need to configure database accesses because it's the wpdb
connection that is used.
We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements. Have a look at our contributing guidelines to find out how to raise a pull request.