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 1mo ago

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 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

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

1361d 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

[watson/validating

Eloquent model validating trait.

9723.3M46](/packages/watson-validating)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[spiritix/lada-cache

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

591444.8k2](/packages/spiritix-lada-cache)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[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.

5462.3k](/packages/io238-laravel-iso-countries)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)

PHPackages © 2026

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