https://github.com/ahmedesa/laravel-api-tool-kit
Your all-in-one solution for building efficient APIs with Laravel.
https://github.com/ahmedesa/laravel-api-tool-kit
api laravel laravel-package
Last synced: 3 months ago
JSON representation
Your all-in-one solution for building efficient APIs with Laravel.
- Host: GitHub
- URL: https://github.com/ahmedesa/laravel-api-tool-kit
- Owner: ahmedesa
- License: mit
- Created: 2021-10-14T18:21:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-03-25T14:37:58.000Z (over 1 year ago)
- Last Synced: 2025-11-27T14:57:12.827Z (7 months ago)
- Topics: api, laravel, laravel-package
- Language: PHP
- Homepage: https://laravelapitoolkit.com/
- Size: 324 KB
- Stars: 510
- Watchers: 10
- Forks: 52
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
Laravel API tool kit
[](https://packagist.org/packages/essa/api-tool-kit)

[](https://packagist.org/packages/essa/api-tool-kit)
## 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 **20 rule files** and **5 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**.
```bash
php artisan api-skill:install
```
### 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, Media |
| **Workflows** | Scan project conventions, new endpoint step-by-step, add filtering, code review checklist, update knowledge base |
| **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 |
> 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 →](https://laravelapitoolkit.com/#/v3/ai-skill)
---
## 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:
```json
{
"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.
```php
$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.
```php
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.
```php
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.
```php
$filePath = MediaHelper::uploadFile($file, $path);
```
### Enums for Clarity
The Enum class provides a way to work with enumerations, eliminating hardcoded values in your code:
```php
namespace App\Enums;
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](#-ai-skill--teach-your-ai-assistant-your-architecture) 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
```
## :film_strip: Video Tour
If you'd prefer a more visual review of this package, please watch this video on Laravel Package Tutorial.
[
](https://youtu.be/lZ9PPW-5utw)
## Official Documentation
Access our documentation to unlock the full potential of the Laravel API Toolkit:
[Explore the Documentation](https://laravelapitoolkit.com/)
## Contributing
We welcome your contributions to help make this package even better. Please refer to our [CONTRIBUTING.md](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](LICENSE.md).