bitapps / wp-database
A simple orm with wpdb
2.0.5
2026-09-03 13:41 UTC
Requires
- php: >=8.0
Requires (Dev)
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main / 2.x-dev
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.x-dev
- 1.11
- 1.10
- 1.9
- 1.8
- 1.7
- 1.6
- 1.5
- 1.4
- 1.3
- 1.2
- 1.1
- 1.0
- dev-feat/innodb-engine-and-named-foreign-keys
- dev-refactor/namespace-grammar
- dev-refactor/relations-static-access
- dev-fix/issues-query-builder
- dev-feat/multi-unique
- dev-fix/sanitize-column
- dev-fix/select-column-pagination-issue
- dev-khoaiz-dev
- dev-improvement/config-update
- dev-shuvomohajan-patch-1
This package is auto-updated.
Last update: 2026-09-04 12:49:51 UTC
README
A small ActiveRecord ORM with a fluent query and schema builder on top of
WordPress' $wpdb.
Install
// composer.json "repositories": [ { "type": "vcs", "url": "https://github.com/Bit-Apps-Pro/wp-database" } ]
composer require bitapps/wp-database:dev-main
Quick start
use BitApps\WPDatabase\Model; class Contact extends Model { protected $fillable = ['name', 'email']; public function deals() { return $this->hasMany(Deal::class, 'contact_id', 'id'); } } Contact::insert(['name' => 'Ada', 'email' => 'ada@x.com']); $active = Contact::where('is_active', 1) ->withCount('deals') ->orderBy('name')->asc() ->get(); // Collection of Contact models
Documentation
- Usage guide — models, query builder, relationships, casts, events, transactions, and more.
- Relationships —
hasOne/belongsTo/hasMany/belongsToMany, eager & lazy loading, relation aggregates, and limitations. - Schema builder — table creation, columns, indexes, and migrations.
- Breaking changes — upgrade notes.