Download the PHP package yusufgenc/filament-api-forge without Composer

On this page you can find all versions of the php package yusufgenc/filament-api-forge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-api-forge

Filament API Forge

Automatically expose your Filament Resources as fully-featured REST APIs — with hash-based authentication, interactive OpenAPI documentation, per-resource access control, rate limiting, and IP restrictions. No Sanctum required.

Latest Version on Packagist PHP Version Filament Version


Screenshots

Developer Center

API Keys

API Docs

Access Control

Settings

Public Docs — Light Mode

Public Docs — Dark Mode


Features

Feature Description
Auto-Discovery Detects any Resource implementing HasApi — zero manual route registration
Hash-Based Auth forge_ prefix tokens (SHA-256 hashed at rest), Stripe/OpenAI style
CRUD Endpoints index, show, store, update, destroy — enable only what you need
Spatie Query Builder Filtering, sorting, field selection, eager loading, full-text search out of the box
Scope Enforcement Per-token read / write / delete scopes, plus * for full access
Access Control Dedicated panel page — enable/disable methods or entire resources, set rate limits and IP rules
Rate Limiting Global, per-resource, and per-method limits — method overrides resource, resource overrides global
IP Restrictions Whitelist IPs per resource or per method (CIDR, wildcard, exact)
OpenAPI Docs Dynamically generated OpenAPI 3.0 spec with interactive Swagger UI
Public Docs Publish your API docs to a standalone public URL with a single click — light/dark mode included
Route Segment Replace the panel ID in API paths with a custom segment (e.g. /filament/posts)
Request Counters Per-token request count tracking with abbreviated display (1K, 2.4M) and one-click reset
Developer Center Dashboard, API key management, documentation, access control, and settings — all in one panel group

Requirements


Installation

Publish and run the migrations:

Optionally publish the config file:


Setup

1. Register the Plugin

Add FilamentApiForgePlugin to your panel provider:

All three are enabled by default. You can disable any section:

2. Expose a Resource

Implement HasApi on any Filament Resource and define apiConfig():

apiConfig() Reference

Key Type Description
allowed_methods string[] CRUD operations to expose: index, show, store, update, destroy
allowed_filters string[] Columns clients can filter by (?filter[title]=foo)
allowed_sorts string[] Columns clients can sort by (?sort=-created_at)
allowed_includes string[] Eloquent relations to eager-load (?include=author)
allowed_fields string[] Columns clients can select (?fields[posts]=id,title)
searchable string[] Columns searched via ?search=query
scopes string[] Required token scopes: read, write, delete
validation_rules array Explicit rules for store/update. Falls back to allowed_fields$fillable

3. Enrich the OpenAPI Docs (optional)

Decorate your Resource class with PHP 8 attributes to improve generated documentation:

Attribute Description
#[ApiTag('Name')] Groups endpoints under a named tag in the OpenAPI spec
#[ApiDescription('...')] Sets the resource description
#[ApiOperations(...)] Per-method summaries and descriptions
#[ApiIgnore] Excludes the resource from the spec entirely

Authentication

All API requests must include a Bearer token:

Token Format

Tokens use the forge_ prefix followed by 40 random characters (238 bits of entropy). The plain-text token is shown once at creation — only its SHA-256 hash is stored.

Scopes

Scope Allowed operations
read GET (index, show)
write POST, PUT, PATCH (store, update)
delete DELETE (destroy)
* Full access

Tokens can also be restricted to specific resources via Resource Access in the API Keys page.


Making API Requests

The base URL pattern is:

Where {segment} is the panel ID (admin) by default, or a custom route segment if configured.

Examples

Query Parameters

Parameter Example Description
filter[field] ?filter[status]=published Filter by field value (partial match)
sort ?sort=-created_at Sort ascending or descending (prefix - for desc)
include ?include=author,category Eager-load relations
fields[resource] ?fields[posts]=id,title Sparse fieldsets
search ?search=laravel Full-text search across searchable columns
per_page ?per_page=50 Results per page (capped by max_per_page config)

Response Format

Collection (index)

Single record (show / store / update)

Error responses

Status error key Cause
401 unauthenticated Missing or invalid token
403 insufficient_scope Token lacks required scope
403 resource_not_allowed Token restricted to other resources
403 ip_forbidden Client IP is not whitelisted
404 not_found Resource or record not found / disabled
405 method_not_allowed Method is disabled for this resource
422 (validation) Request data failed validation
429 rate_limit_exceeded Too many requests

Developer Center

The Developer Center is embedded in your Filament panel under the Developer Center navigation group.

Page URL Description
Dashboard /admin/developer/dashboard Stats overview (resources, endpoints, tokens, total requests with abbreviated counts), resource list, and quick-start examples
API Keys /admin/developer/api-keys Create, inspect, and revoke tokens with scope and resource restrictions
API Docs /admin/developer/api-docs Interactive OpenAPI documentation with try-it-out panel and Publish Docs button
Access Control /admin/developer/access-control Enable/disable resources and individual methods; set rate limits and IP whitelists per resource or method
Settings /admin/developer/settings Configure route segment, view route preview, and reset request counters

Access Control

The Access Control page lets you manage per-resource settings without touching code.


Public API Docs

The Publish Docs button on the API Docs page makes your documentation available at a public URL — no login required:

The page uses Swagger UI with full light/dark mode support (default light, toggle persisted in localStorage). When unpublished, the URL returns 403.

The Copy Public URL button (visible when published) shows the URL in a notification for easy copying.


Route Segment

By default, API paths include the Filament panel ID:

You can replace admin with any custom segment from Developer Center → Settings, or via environment variable:

Result:

Note: Both the original panel-ID paths and the new segment work simultaneously — no breaking changes to existing integrations.

The Settings page shows a live Route Preview table so you can see exactly how paths will appear in the docs before saving.


Request Counters

Every API call increments the request_count on the token used. The Dashboard displays the all-time total with abbreviated formatting (1.2K, 3.5M, 2.1B — hover for exact value).

From Settings → Request Counters you can:


Configuration


License

This package is open-sourced software licensed under the MIT license.


Credits

Built by Yusuf Genc.
Powered by Filament and Spatie Laravel Query Builder.


All versions of filament-api-forge with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^5.0
illuminate/contracts Version ^12.0|^13.0
spatie/laravel-package-tools Version ^1.16
spatie/laravel-query-builder Version ^5.0|^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yusufgenc/filament-api-forge contains the following files

Loading the files please wait ...