essa/api-tool-kit
Composer 安装命令:
composer require essa/api-tool-kit
包简介
set of tools to build an api with laravel
README 文档
README
Introduction
Build production-grade Laravel APIs with standardized responses, dynamic pagination, advanced filtering, and built-in AI architectural rules that teach your coding assistant to follow your standards from the first draft.
Installation
composer require essa/api-tool-kit
🤖 AI Skill — Teach Your AI Assistant Your Architecture
Ship production-grade APIs faster by giving your AI coding assistant a shared understanding of your architecture. One command installs 21 rule files and 8 guided workflows that ensure every AI-generated file fits your codebase from the first draft — no manual corrections needed.
Supports Claude Code, Cursor, GitHub Copilot, and Antigravity.
Full experience — slash commands, auto-loaded rules, per-tool native configuration:
php artisan api-skill:install [tool]
Supported tools: claude, cursor, copilot, antigravity. The installer copies rules and workflows to the correct location for your tool — e.g. /investigate, /code-review, /new-endpoint become real slash commands in Claude Code.
Quick setup via Laravel Boost — agent-agnostic, works with all AI tools:
php artisan boost:add-skill ahmedesa/laravel-api-tool-kit
Installs to .ai/skills/laravel-api-tool-kit/ — a universal location Claude Code, Cursor, Copilot, Antigravity, and Gemini all read from on demand. No slash commands, but zero configuration.
Tip
In non-interactive environments (Docker/CI), bypass the selection prompt with:
php artisan boost:add-skill ahmedesa/laravel-api-tool-kit --skill=laravel-api-tool-kit
What's included
| Category | Contents |
|---|---|
| Rules | Controllers, Models, Actions, DTOs, Services, Repositories, Filters, Enums, Events, Requests, Resources, Responses, Exceptions, Authorization, Testing, Database, Pagination, Anti-patterns, Code Quality, DDD, Dependency Injection |
| Workflows | New endpoint, add filtering, code review, investigate, curl-test, organize knowledge, update knowledge, create workflow |
| DDD Support | Works with both standard Laravel and Domain-Driven Design layouts |
| Project Defaults | Configure primary key type, auth guard, and test base class once — the AI applies them everywhere |
Tip
The AI Skill is the recommended way to generate code for projects using this package. It replaces the need for scaffolding generators by teaching your AI assistant the full architecture.
Read the full AI Skill documentation →
Why Choose the Laravel API Toolkit?
🤖 Built for AI-Assisted Development
The built-in AI Skill teaches your coding assistant to generate code that follows your architecture out of the box — no more fixing AI output to match your standards.
Consistent Responses, Less Hassle
The API Response feature simplifies generating consistent JSON responses. It provides a standardized format for your API responses:
{
"message": "your resource successfully",
"data": [
...
]
}
Pagination Done Right
Don't fuss over managing the number of results per page. The dynamic pagination feature adapts effortlessly to your needs, giving you control without complications.
$users = User::dynamicPaginate();
Simplified Filtering
Refine query results with simplicity. The powerful filtering system lets you filter, sort, search, and even include relationships with ease.
Car::useFilters()->get();
Logic Made Clear
Tackle complex business logic with Actions. These gems follow the command pattern, boosting readability and maintenance for your code.
class CarController extends Controller { public function __construct( private readonly CreateCarAction $createCar, ) {} public function store(CreateCarRequest $request): JsonResponse { $car = $this->createCar->execute($request->validated()); return $this->responseCreated(trans('car.created'), new CarResource($car)); } }
Media? Handled.
Handle file uploads and deletions like a pro. The Media Helper streamlines media management, leaving you with clean and organized file handling.
$filePath = MediaHelper::uploadFile($file, $path);
Enums for Clarity
The Enum class provides a way to work with enumerations, eliminating hardcoded values in your code:
enum UserType: string { case ADMIN = 'admin'; case STUDENT = 'student'; }
API Generator
The API Generator automates file setup, creating key files from migrations to controllers. Use one command to kickstart your API development.
Note
For AI-assisted development, the AI Skill is the recommended approach. It teaches your AI assistant the full architecture so generated code fits your project from the start. The API Generator remains available for developers who prefer traditional scaffolding.
php artisan api:generate ModelName --all
🎞️ Video Tour
If you'd prefer a more visual review of this package, please watch this video on Laravel Package Tutorial.
Official Documentation
Access our documentation to unlock the full potential of the Laravel API Toolkit:
Contributing
We welcome your contributions to help make this package even better. Please refer to our CONTRIBUTING.md file for contribution guidelines.
License
By contributing to the Laravel API Toolkit, you agree that your contributions will be licensed under the project's MIT License.
essa/api-tool-kit 适用场景与选型建议
essa/api-tool-kit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 87.93k 次下载、GitHub Stars 达 534, 最近一次更新时间为 2021 年 10 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「tools」 「laravel」 「filters」 「api-generator」 「dynamic-pagination」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 essa/api-tool-kit 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 essa/api-tool-kit 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 essa/api-tool-kit 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A set of useful PHP classes.
A Laravel package to retrieve data from Google Search Console
A PSR-7 compatible library for making CRUD API endpoints
GHT D-Tools Bundle
Allow KoolReport to use twig template engine to render view
Asynchronous MQTT client built on React
统计信息
- 总下载量: 87.93k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 534
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-10-17

