I created a Laravel package to generate clean API modules
I created a Laravel package to generate clean API modules
我创建了一个用于生成整洁 API 模块的 Laravel 包
Hi everyone, I just released my first package — strides/laravel-api-module. 大家好,我刚刚发布了我的第一个 Laravel 包 —— strides/laravel-api-module。
The idea was simple: stop copying the same boilerplate code every time you create a new API resource. So I made a generator that creates a clean module structure using the Action + Repository + Transformer pattern. 我的初衷很简单:不想在每次创建新的 API 资源时都重复复制相同的样板代码。因此,我制作了一个生成器,它可以使用“Action + Repository + Transformer”模式来创建整洁的模块结构。
What you get with one command: 通过一条命令,你可以获得:
-
Action classes
-
Repository with interface
-
Transformer (using spatie/laravel-data)
-
Model and migration
-
Routes file
-
Action 类
-
带有接口的 Repository
-
Transformer(使用 spatie/laravel-data)
-
模型和迁移文件
-
路由文件
The package is well documented with examples. Would love to hear your feedback and suggestions! 该包提供了完善的文档和示例。非常期待听到大家的反馈和建议!
Links: 链接:
Documentation: https://strides-hovo.github.io/Laravel-api-module/ 文档:https://strides-hovo.github.io/Laravel-api-module/
GitHub: https://github.com/strides-hovo/Laravel-api-module GitHub:https://github.com/strides-hovo/Laravel-api-module
Packagist: https://packagist.org/packages/strides/laravel-api-module Packagist:https://packagist.org/packages/strides/laravel-api-module