ModelReflection
The package allows you to reflect properties and methods of the model and save the received information in the 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_reflection = ModelReflection::make('App\User');
this will return ReflectedModel containing information about:
- class name
- table name
- fields
- relations
- table foreign keys
- scopes
or you can do:
$user_schema = ModelReflection::getModelSchema('App\User');
this will return an associative array for JSON representation.
Change log
Please see the changelog for more information on what has changed recently.
Testing
coming soon...
$ composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email shirokovnv@gmail.com instead of using the issue tracker.
Credits
License
MIT. Please see the license file for more information.