For an active-record ORM for PHP, the first results are mongodb/laravel-mongodb (This repository brings MongoDB support to Laravel's Eloquent, giving you Active Record model mapping, CRUD methods, query building, associations, and callbacks—exactly what you'd expect from a PHP Active Record ORM, though tailored for NoSQL rather than relational databases), yiisoft/yii2 and jenssegers/laravel-mongodb (This MongoDB Eloquent ORM for Laravel implements the Active Record pattern with model mapping, CRUD, and query builder features, making it a valid ORM for PHP, though its NoSQL focus means it lacks relational table-mapping and traditional migration support). illuminate/database and seaql/sea-orm round out the shortlist. Compare the match explanations and check the project documentation against your requirements.
PHP libraries that implement the active record pattern for database interaction and object relational mapping.
This project is a MongoDB database driver and object-relational mapper that brings MongoDB support to the Laravel Eloquent model and query builder. It provides a NoSQL model mapper that allows MongoDB collections to be mapped to object-oriented models using the Active Record pattern. The integration enables the use of a fluent query builder for constructing queries and aggregation pipelines without writing raw database syntax. It supports schema-less model integration, allowing applications to manage unstructured data while maintaining compatibility with standard object-oriented patterns. Th
This repository brings MongoDB support to Laravel's Eloquent, giving you Active Record model mapping, CRUD methods, query building, associations, and callbacks—exactly what you'd expect from a PHP Active Record ORM, though tailored for NoSQL rather than relational databases.
Yii2 is a professional PHP web framework designed for developing high-performance, scalable enterprise web applications. It utilizes a Model-View-Controller architecture to separate data logic, user interfaces, and request handling, ensuring maintainability for large-scale projects. The framework includes a built-in PHP code generator that automates the creation of boilerplate controllers and models by scanning database schemas. It provides an Active Record object-relational mapping system where classes represent tables and instances represent rows to manage data persistence. Additional capa
Yii2 ships with a mature Active Record ORM that maps tables to classes, provides CRUD methods, migration support, a query builder, associations (hasMany, belongsTo), validation/callbacks, and lazy/eager loading, so it squarely delivers everything the visitor needs even though it comes inside a full web framework.
This project is a MongoDB Eloquent ORM and NoSQL query builder for the Laravel framework. It provides an active record implementation that maps MongoDB collections and documents to programmable models for data manipulation. The system enables schemaless data management, allowing applications to handle dynamic data structures without the need for rigid database migrations or predefined tables. It integrates MongoDB into Laravel applications to store and retrieve flexible document data using standard PHP patterns. The library covers document store querying and Eloquent model mapping, utilizing
This MongoDB Eloquent ORM for Laravel implements the Active Record pattern with model mapping, CRUD, and query builder features, making it a valid ORM for PHP, though its NoSQL focus means it lacks relational table-mapping and traditional migration support.
READ ONLY Subtree split of the Illuminate Database component (see laravel/framework)
Illuminate Database provides Eloquent, a full-featured Active Record ORM for PHP with table mapping, CRUD, query builder, migrations, associations, and lazy/eager loading—perfectly matching your requirement for an ORM implementing the Active Record pattern.
Sea-ORM is an asynchronous SQL object-relational mapper and database toolkit for mapping relational tables to strongly typed objects. It provides a relational database mapper for performing CRUD operations across MySQL, PostgreSQL, and SQLite, and includes a programmatic dynamic query builder for constructing complex SQL statements. The project distinguishes itself by providing a GraphQL schema generator that transforms database entities into typed schemas with built-in pagination and filters. It also features a dedicated database migration tool for defining and applying versioned schema chan
Sea-ORM is a full-featured ORM with Active Record-style patterns for Rust, but the visitor specifically needs a PHP library — the language mismatch makes it a neighbouring category rather than a direct answer.
Objection.js is an object-relational mapper for Node.js that maps SQL database tables to classes and rows to model instances. It functions as a high-level abstraction layer built on top of the Knex.js query builder to provide structured model definitions and relational data mapping. The project distinguishes itself through its ability to manage complex object graphs, allowing for the persistence and eager-loading of deeply nested related data in single operations. It incorporates a data integrity layer that uses JSON schema validation to verify model instances before they are persisted to the
Objection.js is an ORM for Node.js/JavaScript, not PHP — it maps SQL tables to JavaScript classes with active-record-like features, but does not serve the PHP requirement of this search.
Think is a PHP web framework and object-relational mapper designed for building web applications. It functions as a structured foundation for application development, incorporating a dependency injection container to manage object lifecycles and reduce coupling between components. The project includes a remote application debugger that allows for the inspection of internal state and variables from an external environment. It implements a model-view-controller architecture to separate application logic and data from the user interface. This includes a request pipeline for routing and middlewa
ThinkPHP is a full-stack MVC framework that includes an Active Record ORM component, but it is not a standalone ORM library as the visitor is looking for.
Gel is an object-relational database system that models data as a graph of interconnected objects. By utilizing a strongly typed schema, it enables complex relational queries and polymorphic data structures without the need for traditional join tables. The system integrates native vector storage and similarity search operators, allowing it to function as both a relational and a vector database for semantic data retrieval. The platform distinguishes itself through a comprehensive suite of developer-centric automation tools. It features a declarative migration system that tracks and versions sc
Gel is an object-relational database system, not a PHP ORM library; while it models data as objects, it is a database platform rather than a library implementing the Active Record pattern for PHP.
Sequel is a relational database toolkit for Ruby that provides object-relational mapping, a fluent SQL query builder, and schema migration capabilities. It maps database tables to Ruby classes with support for associations, validations, lifecycle hooks, and eager loading, offering a comprehensive ORM layer for building data-centric applications. Sequel distinguishes itself through a plugin-based extension architecture that allows composable customization of models, databases, and datasets without relying on deep inheritance hierarchies. It includes a thread-safe connection pool with support f
Sequel is a Ruby ORM library with the Active Record pattern you are looking for, but it is built for Ruby rather than PHP, so it does not fit the language requirement of your search.
Peewee is a SQL object-relational mapper and query builder that provides an object-oriented interface for mapping application classes to relational database tables. It functions as a relational database toolkit for managing schemas, executing migrations, and handling complex table relationships. The project distinguishes itself by providing an asyncio database driver for non-blocking database operations, ensuring event loop responsiveness. It also supports semi-structured data storage, allowing the storage and querying of flexible JSON documents within traditional relational database systems.
Peewee is a Python ORM with table-to-class mapping, migrations, associations, and query building, but it is not implemented in PHP as the visitor requires.
Entity Framework Core is an object-relational mapper that enables developers to interact with database systems using strongly-typed code. It serves as a comprehensive data access framework, providing a unified interface for mapping application objects to relational and non-relational database schemas while managing the lifecycle of data operations through a central context. The project distinguishes itself through a provider-based architecture that decouples core data access logic from specific database engines, allowing for consistent interaction across diverse storage systems. It features a
Entity Framework Core is a powerful ORM for the .NET ecosystem, but this search explicitly requires a PHP library; its language and framework are a mismatch for the requested Active Record ORM for PHP.
Laravel is a comprehensive full-stack web framework designed for building scalable server-side applications. It provides an integrated development environment that centers on an object-relational mapper for database abstraction, a robust routing system, and a sophisticated service container for dependency injection. The framework is built to handle complex application requirements through a modular architecture that emphasizes convention over configuration. What distinguishes Laravel is its deep integration of background processing and event-driven communication. It features a task queue orch
Laravel is a full-stack web framework rather than a standalone ORM library; although it includes Eloquent, an Active Record ORM, the repository itself is the framework, not the focused library the search is after.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| mongodb/laravel-mongodb | 7.1K | PHP | MIT | |
| yiisoft/yii2 | 14.3K | PHP | BSD-3-Clause | |
| jenssegers/laravel-mongodb |
| 7.1K |
| PHP |
| MIT |
| illuminate/database | 2.8K | PHP | MIT |
| seaql/sea-orm | 9.4K | Rust | apache-2.0 |
| vincit/objection.js | 7.3K | JavaScript | MIT |
| top-think/think | 7.9K | PHP | NOASSERTION |
| geldata/gel | 14.1K | Python | apache-2.0 |
| jeremyevans/sequel | 5.1K | Ruby | other |
| coleifer/peewee | 12K | Python | MIT |