petenys/laravel-json-api-generator

PeteNys Laravel JsonApi Generator

dev-master 2020-01-29 23:26 UTC

This package is auto-updated.

Last update: 2024-09-29 05:42:21 UTC


README

假设你创建了一个新表并运行了迁移(invoices),然后你只需运行以下命令

php artisan petenys:json_api Invoice --fromTable --tableName=invoices --relations

这将构建模型、仓库、策略、观察者、适配器、模式、验证器,并添加路由、json-api-v1 资源,还将观察者添加到观察者提供者,并添加它从外键中可以识别的所有关系

使用 --include=controller,tests 还会添加这些对象

或者你可以单独调用任何构建命令... petenys:adapter 或 petenys:controller 或等等