Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Api Forge Laravel Package

yusufgenc/filament-api-forge

Expose Filament Resources as REST APIs automatically—no Sanctum. Hash-based API keys with scopes, per-resource access control, rate limiting, IP restrictions, Spatie Query Builder filtering/sorting, and auto-generated OpenAPI + public Swagger docs.

View on GitHub
Deep Wiki
Context7

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
roundly-consulting/kubernetes-api-for-laravel
roundly-consulting/plausible-for-laravel
gvp/gvp-laravel-template
metasyncsite/laravel-metasync-client
roundly-consulting/onboarding-for-laravel
andydefer/laravel-notification
adachsoft/cli-process-tester
jhaskell13/laraflow
sebastienheyd/boilerplate-media-manager
ccast/tagixo-primix
pretendtrue/laravel-builder
sawmainek/laravel-scout-tntsearch-driver
tomshaw/laravel-calendar-table
dibakar/laravel-ownership
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo