yusufgenc/filament-api-forge
| Install | |
|---|---|
composer require yusufgenc/filament-api-forge |
|
| Latest Version: | 1.4.0 |
| PHP: | ^8.2 |
| License: | MIT |
| Last Updated: | Jul 30, 2026 |
| Links: | GitHub · Packagist |
Filament API Forge
Automatically turn your Filament Resources into fully-featured, secure, and documented REST and GraphQL APIs with zero route boilerplate.
Screenshots
| Developer Center | API Keys |
|---|---|
![]() |
![]() |
| Interactive OpenAPI Docs | Access Control |
|---|---|
![]() |
![]() |
| Settings | Webhooks |
|---|---|
![]() |
![]() |
| Public Documentation |
|---|
![]() |
Overview
Building APIs for Laravel apps often requires writing redundant controllers, form requests, policies, and Swagger documentation for every model. Filament API Forge eliminates this boilerplate by extending Filament's Server-Driven UI concept straight to your API layer.
Simply implement HasApi on any Filament Resource and get an instant REST (and optional GraphQL) API with token authentication, rate limiting, IP protection, policy enforcement, and live Swagger documentation.
Features
| Feature | Description | Reference |
|---|---|---|
| Auto-Discovery | Detects resources implementing HasApi with zero route registration |
Exposing Resources |
| Hash-Based Auth | forge_ tokens hashed at rest (SHA-256) — no Sanctum required |
Authentication |
| Policy Authorization | Automatic Laravel Model Policy integration (Gate::authorize) |
Policies |
| Spatie Query Builder | Filtering, sorting, sparse fieldsets, relation includes out of the box | Query Building |
| Custom Eloquent Resources | Use custom JsonResource classes per resource |
Custom Formatting |
| Relation Syncing | Auto-sync BelongsToMany and MorphToMany relations on write |
Relation Syncing |
| Batch Operations | Bulk create, update, delete, restore, and forceDelete in one request |
Batch Operations |
| File Uploads | Multipart form data uploads for Filesystem & Spatie Media Library | File Uploads |
| OpenAPI & Public Docs | Auto-generated OpenAPI 3.0 specs with interactive Swagger UI | Documentation |
| Developer Center | Panel pages for API Key Management, Settings, Logs & Access Control | Panel Pages |
Quick Start
1. Install via Composer
composer require yusufgenc/filament-api-forge
php artisan vendor:publish --tag="filament-api-forge-migrations"
php artisan migrate
2. Register Plugin in your Panel Provider
use YusufGenc34\FilamentApiForge\FilamentApiForgePlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugin(FilamentApiForgePlugin::make());
}
3. Expose a Resource
Implement HasApi on your Filament Resource and add apiConfig():
use YusufGenc34\FilamentApiForge\Contracts\HasApi;
class PostResource extends Resource implements HasApi
{
public static function apiConfig(): array
{
return [
'allowed_methods' => ['index', 'show', 'store', 'update', 'destroy'],
'allowed_filters' => ['title', 'status'],
'allowed_sorts' => ['created_at'],
'use_policies' => true,
'validation_rules' => [
'title' => ['required', 'string', 'max:255'],
],
];
}
}
Your API endpoint is ready at /api/v1/admin/posts.
Documentation
For comprehensive documentation covering Hooks, Uploads, Custom Actions, Nested Resources, GraphQL, Webhooks, Multi-Tenancy, and API Versioning, see DOCS.md.
Contributing
Contributions are welcome! Whether it is fixing a bug, improving documentation, or proposing a new feature, your help is appreciated.
Development Setup
- Fork and clone the repository.
- Install dependencies:
composer install - Run the test suite:
./vendor/bin/pest - Format code style before submitting a pull request:
vendor/bin/pint
Please ensure all tests pass and new features include test coverage.
Security Vulnerabilities
If you discover a security vulnerability within Filament API Forge, please send an issue or email to the maintainers. All security vulnerabilities will be promptly addressed.
Support & Credits
If you find this package useful, please consider giving it a star on GitHub to support its development!
Created and maintained by Yusuf Genc.
License
The MIT License (MIT). Please see License File for more information.
Related Packages
OpenApi(Swagger) 3.0 package for Lumen 5.5+ and Laravel 5.5+ with REDOC UI and S...
OpenApi(Swagger) 3.0 package for Lumen 5.5+ and Laravel 5.5+ with REDOC UI and S...






