grixu / socius-models
此包已被废弃且不再维护。未建议替代包。
用于Socius API及所有使用Socius并需要保留本地数据副本的应用的模型。
v4.0.0
2022-07-24 13:15 UTC
Requires
- php: ^8.0
- grixu/data-factories: ^2.0
- grixu/socius-dto: ^2.0
- illuminate/database: ^9.0
- illuminate/support: ^9.0
- spatie/data-transfer-object: ^3.8
- spatie/laravel-enum: ^3.0
Requires (Dev)
- brainmaestro/composer-git-hooks: ^v3.0.0-alpha.1
- doctrine/dbal: ^3.1
- friendsofphp/php-cs-fixer: ^3.0
- nunomaduro/larastan: ^1.0.0
- nunomaduro/phpinsights: ^2.0
- orchestra/testbench: ^7.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.13
- spatie/x-ray: ^1.1
- dev-main
- v4.0.0
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.1
- 3.1.0
- 3.0.0
- v2.4.4
- v2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.0
- 2.0.1
- 2.0.0
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- dev-dependabot/github_actions/shivammathur/setup-php-2.23.0
- dev-dependabot/github_actions/8398a7/action-slack-3.15.0
- dev-dependabot/github_actions/dependabot/fetch-metadata-1.3.5
- dev-dependabot/github_actions/actions/cache-3.0.11
- dev-dependabot/github_actions/actions/checkout-3.1.0
- dev-dependabot/composer/nunomaduro/larastan-tw-1.0.0or-tw-2.0.0
This package is auto-updated.
Last update: 2023-01-26 01:18:38 UTC
README
此包包含Socius API和所有使用Socius并需要保留本地数据副本的应用的模型。
安装
您可以通过composer安装此包
composer require grixu/socius-models
用法
模型分为5个模块
- product
- customer
- operator
- warehouse
- description
当然,一些模型之间存在跨模块关系。其中一些非常自然,如:描述有指向产品的外键(这是显而易见的)。我们创建了迁移、模型和工厂,尽可能灵活。因此,我们只假设每个模块中存在表格 - 模型仅检查跨模块关系中的表格是否存在。
发布迁移
默认情况下,包不会将迁移加载到您的应用程序中。您必须手动完成此操作 - 这使您能够控制表结构 - 如果您想添加一些自定义字段。如果您这样做,请记住扩展模型并重写默认的 $fillable
。
要发布迁移
# php artisan vendor:publish --tag=socius-migrations-model-name # Eg: php artisan vendor:publish --tag=socius-migrations-branch # Or all at once: php artisan vendor:publish --tag=socius-migrations
生成模型 & 工厂
您还可以创建本地、可自定义的模型及其工厂的版本。为此,只需键入
# php artisan socius:model-name ModelNameInLocalApp # Eg: php artisan socius:product MyProduct
您也可以使用自定义命名空间为模型和工厂生成它们
php artisan socius:product MyProduct Custom\\Namespace\\Models Custom\\Namespace\\Factories
以相同的方式处理工厂
# php artisan socius:model-name-factory ModelNameInLocalApp # Eg: php artisan socius:product-factory MyFactory # With custom namespace: php artisan socius:product-factory MyFactory Custom\\Namespace\\Factories Custom\\Namespace\\Models
测试
composer test
更新日志
请参阅更新日志了解最近发生了什么更改。
贡献
请参阅贡献指南以获取详细信息。
安全性
如果您发现任何安全相关的问题,请通过电子邮件mateusz.gostanski@gmail.com联系我们,而不是使用问题跟踪器。
致谢
许可协议
MIT许可协议(MIT)。请参阅许可文件以获取更多信息。