yusufgenc/filament-api-forge

Automatically expose your Filament Resources as fully-featured REST APIs with authentication, documentation, rate limiting and query builder support.
1,072 19
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
Maintainer: yusufgenc

Filament API Forge

Automatically turn your Filament Resources into fully-featured, secure, and documented REST and GraphQL APIs with zero route boilerplate.

Latest Version on Packagist PHP Version Filament Version License


Screenshots

Developer Center API Keys
Dashboard API Keys
Interactive OpenAPI Docs Access Control
API Docs Access Control
Settings Webhooks
Settings Webhooks
Public Documentation
Public Docs

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

  1. Fork and clone the repository.
  2. Install dependencies:
    composer install
    
  3. Run the test suite:
    ./vendor/bin/pest
    
  4. 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

vyuldashev/laravel-openapi

Generate OpenAPI Specification for Laravel Applications

1,258,592 461
io-digital/opendox

OpenApi(Swagger) 3.0 package for Laravel 9 with REDOC UI and SwaggerUI 3

1,452 1
noitran/opendox

OpenApi(Swagger) 3.0 package for Lumen 5.5+ and Laravel 5.5+ with REDOC UI and S...

14,553 22
miladnouri/opendox

OpenApi(Swagger) 3.0 package for Lumen 5.5+ and Laravel 5.5+ with REDOC UI and S...

710 0
api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

52,374,108 2,565