webman/think-orm
Integrates ThinkORM with webman, bringing ThinkPHP's ORM, models, and query builder to webman applications. Configure database connections and use familiar ThinkORM APIs for rapid PHP development.
Framing correction (read first). Despite the "Laravel/PHP package" framing, webman/think-orm is not a Laravel package and has no relationship to Eloquent, the Laravel service container, or illuminate/database. It is a webman framework plugin (Workerman-based, resident-memory PHP application server) that wires topthink/think-orm — the standalone ORM extracted from ThinkPHP — into webman's bootstrap and config lifecycle. Any evaluation that assumes Laravel idioms (Eloquent models, RefreshDatabase, Telescope, queue/transaction helpers) will produce the wrong conclusion. Treat this as a webman-only, ThinkPHP-ecosystem decision.
Architecture fit. The package is deliberately thin: it registers the ORM as a webman plugin, publishes a config file, and calls Db::setConfig() so the ThinkORM static facade resolves against app config. That is the correct architectural shape for webman — it keeps the ORM outside the framework core and lets the plugin be swapped for webman/database (illuminate-based) without touching application code structure. Fit is good if and only if the surrounding stack is webman and the team's model layer is written against ThinkORM's Model/Db API. Fit is poor for a Laravel codebase, a Symfony codebase, or a team standardized on Eloquent.
Integration feasibility. Low mechanical effort, high semantic effort:
composer require webman/think-orm, run the plugin install command to publish config, set connection params, done. Hours, not weeks.hasOne/hasMany/belongsToMany differ in naming and lazy/eager loading syntax), soft deletes, model events, and Db::raw behavior are similar but not identical to Eloquent. Any ported model layer needs line-by-line review. Budget for this, not for the install.Technical risk — the resident-memory problem is the whole risk. In webman, worker processes persist across requests and the ORM's connection/transaction state is process-static. Consequences a TPM must force onto the table:
onWorkerStart/request-end middleware calling rollback-if-active and Db::close() where appropriate).wait_timeout silently kills idle connections; without reconnect handling you get "server has gone away" under low traffic followed by a traffic spike.max_connections fast and is invisible in FPM-based capacity models.topthink/think-orm 2.x vs 3.x, PHP 8.x, webman 1.x vs 2.x — pin explicitly and test the exact triple.Signal quality. 9 stars and 0 dependents means no meaningful external validation. Mitigating factor: it lives in the webman-php organization, so it is effectively semi-official and maintained alongside the framework rather than by a random contributor. Last release dated 2026-03-25 indicates active upkeep. The 9.52 quality score versus 39.67 opportunity score reads as "does its narrow job well, but the addressable audience is small" — appropriate for infrastructure glue, not a strategic bet.
Key questions to answer before approval
max_connections?webman/database.webman/database?Stack fit. Adopt only where the stack is: PHP 8.x + webman 2.x + MySQL/PostgreSQL + topthink/think-orm 3.x. This package is the only supported path to ThinkORM on webman; there is no alternative vendor to evaluate against, so the real comparison is ThinkORM-on-webman versus illuminate-on-webman (webman/database), not this package versus other packages.
Migration path. Do not run both ORMs. Two connection managers in one resident process means double the connection footprint, two transaction semantics, and two places for state to leak. Choose one.
Model, adopt Db:: for raw queries. Straightforward.Db::table() and keep transactions explicit.Compatibility. Pin webman/think-orm, topthink/think-orm, workerman/webman-framework, and PHP in composer.json with exact or ~ constraints, and run CI against that matrix. The plugin is glue code — the version risk lives in the ORM and framework it bridges, so that is where the lockfile discipline belongs.
Sequencing.
wrk/ab to surface connection and transaction-state behavior. This spike answers most of the risk above cheaply.Maintenance. Low code surface (thin adapter), but the maintenance burden is transferred to the pinned ORM and framework versions. Small team, semi-official stewardship, MIT license — no vendor relationship, no SLA, no support contract. Acceptable for internal tooling; needs a named internal owner either way. Budget a recurring dependency-review line item, not a one-off.
Support. No commercial support. Recourse is GitHub issues on webman-php repos and community channels (notably Chinese-language, which is where the webman/ThinkPHP community concentrates — factor in language capability for on-call). Escalation path is "read the source" or "vendor it."
Scaling. Scales with processes, not with requests — the opposite of FPM intuition. Capacity planning must be expressed as workers × connections, and autoscaling must account for connection count as a first-class resource, with a hard ceiling against the database's max_connections. Under horizontal scaling this becomes the binding constraint well before CPU does. If pooling is required, confirm whether the plugin's pool support meets requirements or whether a separate pool plugin is needed — do not assume.
Failure modes to instrument.
start.php reload churns workers and connections in bursts; stagger reloads and watch DB connection graphs during deploys.Db::listen (or equivalent) into existing APM early, since the Laravel observability ecosystem is unavailable.Ramp-up. Developers with ThinkPHP background: hours. Developers whose only ORM experience is Eloquent or Doctrine: days, with the divergence concentrated in relations, eager loading, and model events. Produce a short internal "Eloquent → ThinkORM" cheat sheet during the pilot; it pays for itself in the first sprint.
Recommendation. Proceed only if the application is genuinely webman-based and the team accepts the ThinkORM model API. Otherwise this is a non-starter and the correct evaluation target is webman/database with Eloquent. Conditional on adoption: gate on the spike completing, mandate per-request DB state hygiene before feature work, pin the full version matrix, and record the low-adoption/single-maintainer risk as an accepted, owner-assigned risk in the decision log.
How can I help you explore Laravel packages today?