tomatophp / filament-cms-api
Read-only JSON API for TomatoPHP Filament CMS posts and categories
Fund package maintenance!
Requires
- php: ^8.2
- tomatophp/filament-cms: ^5.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.24
- nunomaduro/collision: ^8.6
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^4.0|^5.0
- pestphp/pest-plugin-arch: ^4.0|^5.0
- pestphp/pest-plugin-laravel: ^4.0|^5.0
- pestphp/pest-plugin-livewire: ^4.0|^5.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-21 09:53:19 UTC
README
Filament CMS Builder APIs
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.
