shirokovnv/model-reflection
Composer 安装命令:
composer require shirokovnv/model-reflection
包简介
Package to reflect the properties and methods of the model
README 文档
README
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 shirokovnv@gmail.com instead of using the issue tracker.
Credits
License
MIT. Please see the license file for more information.
统计信息
- 总下载量: 51
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-01-06