LaravelPackages.net
Acme Inc.
Toggle sidebar
shirokovnv/model-reflection

Package to reflect the properties and methods of the model

51
3
1.0.0
About shirokovnv/model-reflection

shirokovnv/model-reflection is a Laravel package for package to reflect the properties and methods of the model. It currently has 3 GitHub stars and 51 downloads on Packagist (latest version 1.0.0). Install it with composer require shirokovnv/model-reflection. Discover more Laravel packages by shirokovnv or browse all Laravel packages to compare alternatives.

Last updated

ModelReflection

ci.yml Latest Version on Packagist Total Downloads

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

Installation

Via Composer

$ composer require shirokovnv/model-reflection

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

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

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

Credits

License

MIT. Please see the license file for more information.

Comments