PHPackages                             shirokovnv/model-reflection - 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. shirokovnv/model-reflection

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

shirokovnv/model-reflection
===========================

Package to reflect the properties and methods of the model

1.0.0(3y ago)3512MITPHPPHP ^7.4|^8.0

Since Aug 17Pushed 3y ago1 watchersCompare

[ Source](https://github.com/shirokovnv/model-reflection)[ Packagist](https://packagist.org/packages/shirokovnv/model-reflection)[ Docs](https://github.com/shirokovnv/model-reflection)[ RSS](/packages/shirokovnv-model-reflection/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (8)Versions (2)Used By (0)

ModelReflection
===============

[](#modelreflection)

[![ci.yml](https://github.com/shirokovnv/model-reflection/actions/workflows/ci.yml/badge.svg)](https://github.com/shirokovnv/model-reflection/actions/workflows/ci.yml/badge.svg)[![Latest Version on Packagist](https://camo.githubusercontent.com/b375544e030bd4aa8cbdf058ee123971917b6e24621236bedf4fd1fb4fcd385f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736869726f6b6f766e762f6d6f64656c2d7265666c656374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/shirokovnv/model-reflection)[![Total Downloads](https://camo.githubusercontent.com/771f5e13693feec996cbf1e49d422d6dad3f0198a82956d3b92395494f6c69e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736869726f6b6f766e762f6d6f64656c2d7265666c656374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/shirokovnv/model-reflection)

The package allows you to reflect properties and methods of the model and save received information in form of a JSON schema.

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

[](#installation)

Via Composer

```
$ composer require shirokovnv/model-reflection
```

Usage
-----

[](#usage)

This package is based on Doctrine/DBAL

Once installed you can do stuff like this:

```
$user_schema = ModelReflection::reflect(\App\Models\User::class);
```

this will return ReflectedModel containing information about:

- class name
- table name
- fields
- relations
- table foreign keys
- scopes

or you can do:

```
$user_schema->toArray();
```

this will return an associative array for JSON representation.

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Nickolai Shirokov](https://github.com/shirokovnv)
- [All Contributors](../../contributors)

License
-------

[](#license)

MIT. Please see the [license file](license.md) for more information.

###  Health Score

26

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

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

Unknown

Total

1

Last Release

1312d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b6eee3a1104304577fab48df60136b13f5207972c2b644f1030c92ee28d9891?d=identicon)[shirokovnv](/maintainers/shirokovnv)

---

Top Contributors

[![shirokovnv](https://avatars.githubusercontent.com/u/43547352?v=4)](https://github.com/shirokovnv "shirokovnv (35 commits)")

---

Tags

laravelmodelpackagephpreflectionphplaravelreflectioneloquent

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/shirokovnv-model-reflection/health.svg)

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

###  Alternatives

[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

590440.9k2](/packages/spiritix-lada-cache)[io238/laravel-iso-countries

Ready-to-use Laravel models and relations for country (ISO 3166), language (ISO 639-1), and currency (ISO 4217) information with multi-language support.

5358.7k](/packages/io238-laravel-iso-countries)[kiwilan/typescriptable-laravel

PHP package for Laravel to type Eloquent models, routes, Spatie Settings with autogenerated TypeScript. If you want to use some helpers with Inertia, you can install associated NPM package.

4019.6k](/packages/kiwilan-typescriptable-laravel)[sebastiaanluca/laravel-boolean-dates

Automatically convert Eloquent model boolean attributes to dates (and back).

40110.0k1](/packages/sebastiaanluca-laravel-boolean-dates)[rayvenues/eloquent-model-generator

Eloquent Model Generator

1325.1k1](/packages/rayvenues-eloquent-model-generator)[pursehouse/modeler-laravel-eloquent

Generate model classes for Eloquent in Laravel

112.4k](/packages/pursehouse-modeler-laravel-eloquent)

PHPackages © 2026

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