PHPackages                             fr3on/laravel-prism - 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. fr3on/laravel-prism

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

fr3on/laravel-prism
===================

Static Eloquent model auditor - catches $fillable, $casts, $hidden, and factory drift before tests fail silently.

0.0.1(1mo ago)1230↓100%MITPHPPHP ^8.2CI passing

Since Apr 12Pushed 1mo agoCompare

[ Source](https://github.com/fr3on/laravel-prism)[ Packagist](https://packagist.org/packages/fr3on/laravel-prism)[ RSS](/packages/fr3on-laravel-prism/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

Laravel Prism
=============

[](#laravel-prism)

[![Latest Version on Packagist](https://camo.githubusercontent.com/29ecdb507fa8ce2b6c8a33dbe3217c07be1a6279e35f66f279c9ae3c8232069c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6672336f6e2f6c61726176656c2d707269736d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fr3on/laravel-prism)[![GitHub Tests Action Status](https://camo.githubusercontent.com/38e98fa29961b045b6cfc52a793c530d6f887859fe79f61cbd0693bc931325ea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6672336f6e2f6c61726176656c2d707269736d2f63692e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/fr3on/laravel-prism/actions/workflows/ci.yml)[![Total Downloads](https://camo.githubusercontent.com/03ddcf21f031bfe35d19ccd5175db74915c398c78153412d322efcc96e3078f9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6672336f6e2f6c61726176656c2d707269736d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fr3on/laravel-prism)[![PHP Version Support](https://camo.githubusercontent.com/112fdc9102cd1bcea532ede480d2f0b15e4a61b8a1bedacce41efc5d52ba5d89/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d3838393262662e7376673f7374796c653d666c61742d737175617265)](https://www.php.net/)[![Laravel Version Support](https://camo.githubusercontent.com/8a72c4d04b68a3090c6e58daed3f9e27dba8c532b98c482605351f3458c0b2b0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d253545313025374325354531312d6666326432302e7376673f7374796c653d666c61742d737175617265)](https://laravel.com/)[![License](https://camo.githubusercontent.com/3cd7116fb5c6cb598ffaac90a1e509d08e5112fc6545c82ebbdb10b17a002156/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6672336f6e2f6c61726176656c2d707269736d2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Static Eloquent model auditor — catches `$fillable`, `$casts`, `$hidden`, and factory drift before tests fail silently.

Eloquent models accumulate drift. You add a column to a migration, forget to add it to `$fillable`. A new `$cast` is declared for a column that no longer exists. A password column sits in `$fillable` but not in `$hidden`. A factory produces `string` for a field that the model casts as `array`. None of these problems throw an error — they fail silently, corrupt data, or create security holes that only show up under specific conditions.

Prism surfaces these silent issues through static model auditing.

Features
--------

[](#features)

Prism detects 5 major drift patterns:

1. **Sensitive field in `$fillable` but not `$hidden`** (Potential Data Leak)
2. **`$casts` declares a column not in the DB** (Dead Cast)
3. **DB column exists but is absent from `$fillable`** (Missing Fillable)
4. **Factory type mismatches model `$casts`** (Factory Mismatch)
5. **`$guarded = []` with no `$fillable` defined** (Unguarded Model)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require fr3on/laravel-prism --dev
```

You can publish the config file with:

```
php artisan vendor:publish --tag="prism-config"
```

Usage
-----

[](#usage)

Simply run the auditor against your application's models:

```
php artisan model:audit
```

To integrate with your CI testing pipeline and gate deployments on model drift:

```
php artisan model:audit --ci
```

You can also specify particular models to scan:

```
php artisan model:audit --model=User
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance88

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community3

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

58d ago

### Community

---

Top Contributors

[![fr3on](https://avatars.githubusercontent.com/u/26393383?v=4)](https://github.com/fr3on "fr3on (11 commits)")

---

Tags

auditoreloquentfactorylaravelmodelphpprism

### Embed Badge

![Health badge](/badges/fr3on-laravel-prism/health.svg)

```
[![Health](https://phpackages.com/badges/fr3on-laravel-prism/health.svg)](https://phpackages.com/packages/fr3on-laravel-prism)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8361.6M87](/packages/propel-propel1)[mpociot/laravel-composite-key

Support composite keys in your laravel app.

3544.8k1](/packages/mpociot-laravel-composite-key)

PHPackages © 2026

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