Eloquent ORM JS API Reference
Stability contract
- Only exports from
src/index.tsare public and semver-tracked. - The model subpath
src/Model.tsis public and semver-tracked as@alpha.consultings/eloquent-orm.js/Model. - Deep imports from
src/*ordist/*internals are private.
Root package: @alpha.consultings/eloquent-orm.js
ORM Core
BaseModelModelSqlModelMongoModelCoreModelMorphRegistryPivotHelperMixin
Factories and schema
FactorycolumnrelationmixinvalidatevalidateSchemaSchemaBuilderSchemaValidator
Cache and registration
CacheManagersetupCacheregisterModelsisModelRegisteredsetModelRegistryStrictModeisModelRegistryStrictMode
Types
ORMRecord,ModelAttrs,ModelInstance,TypedRelation,PivotRelationPlainObject,ModelCtor,FactoryCtor,ModelEventHooks- schema and validation types used by schema builders and factories
Subpath export: @alpha.consultings/eloquent-orm.js/Model
Named exports
SqlModelMongoModelModelInstanceModelAttrs
Subpath rules
@alpha.consultings/eloquent-orm.js/Modelhas no default export.- It does not expose the root
Modelalias. - Use root import for Laravel-style SQL models:
Common usage
Notes
- CLI commands are not part of the runtime API surface.
- New public exports must be added via
src/index.tsorsrc/Model.ts. - Public changes must be reflected in docs and test surfaces.