PHPackages                             ambitionworks/model-schema - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. ambitionworks/model-schema

ActiveLibrary[Database &amp; ORM](/categories/database)

ambitionworks/model-schema
==========================

Record a schema in a model class, automatically update the database when the schema changes.

0.1.1(5y ago)0131MITPHPCI failing

Since Nov 26Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ambitionworks/model-schema)[ Packagist](https://packagist.org/packages/ambitionworks/model-schema)[ RSS](/packages/ambitionworks-model-schema/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Laravel Model-Schema
====================

[](#laravel-model-schema)

Allows you to define your model's database schema in the model file itself. Field additions, changes, and deletions are automatically detected and applied, after running `php artisan model-schema:migrate`.

Credit
------

[](#credit)

This functionality was 95% lifted from [redbastie/swift](https://github.com/redbastie/swift#automatic-migrations). This stand-alone package changes some terminology and adds some minor additional functionality and tests.

🐉 Here Be Dragons: Indexes
--------------------------

[](#-here-be-dragons-indexes)

> Laravel will automatically generate an index name based on the table, column names, and the index type, but you may pass a second argument to the method to specify the index name yourself

— [Creating Indexes](https://laravel.com/docs/8.x/migrations#creating-indexes)

If you plan on using this package in its current state, **it is best practice to always specify index names**. This is based on a couple of gotchas:

1. This package will generate tables prefixed by `temp_`, which Laravel will then use in the automatically generated index name, which will in-turn throw off the detection of changes to indexes.
2. (On MySQL, at least) Index names are limited to 64 characters, which can be easy to run in to when using the default index name generation, particulary on pivot tables, and further exacerbated by the `temp_` prefix.

A future update to this package may rely on using a parallel database so that prefixes are not required.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

2

Last Release

1993d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/583308?v=4)[Evan Barter](/maintainers/evanbarter)[@evanbarter](https://github.com/evanbarter)

---

Top Contributors

[![evanbarter](https://avatars.githubusercontent.com/u/583308?v=4)](https://github.com/evanbarter "evanbarter (8 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ambitionworks-model-schema/health.svg)

```
[![Health](https://phpackages.com/badges/ambitionworks-model-schema/health.svg)](https://phpackages.com/packages/ambitionworks-model-schema)
```

###  Alternatives

[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58523.9M36](/packages/scienta-doctrine-json-functions)[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4485.3M4](/packages/martin-georgiev-postgresql-for-doctrine)[damienharper/auditor-bundle

Integrate auditor library in your Symfony projects.

4542.8M](/packages/damienharper-auditor-bundle)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[overtrue/laravel-versionable

Make Laravel model versionable.

585308.0k5](/packages/overtrue-laravel-versionable)[worksome/foggy

Foggy is a tool for making database dumps with some data removed/changed.

26571.7k1](/packages/worksome-foggy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
