Search by

tomatophp / filament-cms-api

fadymondy

Read-only JSON API for TomatoPHP Filament CMS posts and categories

Package info

github.com/tomatophp/filament-cms-api

pkg:composer/tomatophp/filament-cms-api

Fund package maintenance!

3x1io

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

5.0.0 2026-09-14 15:15 UTC

This package is auto-updated.

Last update: 2026-09-21 09:53:19 UTC


README

Screenshot

Filament CMS Builder APIs

Latest Stable Version License Downloads Tests

Read-only JSON API for TomatoPHP Filament CMS posts and categories.

Requirements

Package version Filament CMS Filament Laravel PHP
5.x 5.x 5.x 12.x, 13.x 8.2+

Installation

composer require tomatophp/filament-cms-api

The routes are registered automatically. Registering the plugin on a panel is optional:

->plugin(\TomatoPHP\FilamentCmsApi\FilamentCmsApiPlugin::make())

Endpoints

All endpoints are GET, return API resources and live under the api/cms prefix.

Endpoint Description
/api/cms/posts Published posts (paginated). Filters: type, category (slug), tag (slug), trend=1, search, per_page
/api/cms/posts/{slug} A published post with its categories, tags and images
/api/cms/categories Active categories (paginated). Filters: for, type, menu=1, root=1, per_page
/api/cms/categories/{slug} An active category with its active children

Only posts with is_published and a publish date in the past are returned. Translatable fields use the app locale; add ?locale=ar to switch it per request.

Configuration

php artisan vendor:publish --tag="filament-cms-api-config"
return [
    'active' => true,              // register the routes
    'prefix' => 'api/cms',
    'middleware' => ['api'],       // add 'auth:sanctum' to make the API private
    'per_page' => 15,
    'max_per_page' => 100,
    'models' => [
        'post' => \TomatoPHP\FilamentCms\Models\Post::class,
        'category' => \TomatoPHP\FilamentCms\Models\Category::class,
    ],
    'resources' => [
        'post' => \TomatoPHP\FilamentCmsApi\Transformers\PostResource::class,
        'category' => \TomatoPHP\FilamentCmsApi\Transformers\CategoryResource::class,
    ],
];

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security

Please see SECURITY for more information about security.

Credits

License

The MIT License (MIT). Please see License File for more information.