{"id":22238535,"url":"https://github.com/tomatophp/filament-api","last_synced_at":"2025-04-12T07:51:56.515Z","repository":{"id":239001625,"uuid":"798248092","full_name":"tomatophp/filament-api","owner":"tomatophp","description":"Generate APIs from your filament resource using single line of code","archived":false,"fork":false,"pushed_at":"2024-09-23T15:38:15.000Z","size":2493,"stargazers_count":40,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T03:54:09.472Z","etag":null,"topics":["api","filament-plugin","filamentphp","generator","rest","tomatophp"],"latest_commit_sha":null,"homepage":"https://tomatophp.com/en/open-source/filament-api","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomatophp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["3x1io"]}},"created_at":"2024-05-09T11:52:58.000Z","updated_at":"2025-03-11T13:13:04.000Z","dependencies_parsed_at":"2024-05-09T12:06:57.868Z","dependency_job_id":"94447005-4e33-4358-9fae-bb16ec261f07","html_url":"https://github.com/tomatophp/filament-api","commit_stats":null,"previous_names":["tomatophp/filament-api"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomatophp%2Ffilament-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomatophp%2Ffilament-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomatophp%2Ffilament-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomatophp%2Ffilament-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomatophp","download_url":"https://codeload.github.com/tomatophp/filament-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248537029,"owners_count":21120690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","filament-plugin","filamentphp","generator","rest","tomatophp"],"created_at":"2024-12-03T03:16:58.234Z","updated_at":"2025-04-12T07:51:56.491Z","avatar_url":"https://github.com/tomatophp.png","language":"PHP","funding_links":["https://github.com/sponsors/3x1io"],"categories":[],"sub_categories":[],"readme":"![Screenshot](https://raw.githubusercontent.com/tomatophp/filament-api/master/arts/3x1io-tomato-api.jpg)\n\n# Resource API Generator\n\n[![Latest Stable Version](https://poser.pugx.org/tomatophp/filament-api/version.svg)](https://packagist.org/packages/tomatophp/filament-api)\n[![License](https://poser.pugx.org/tomatophp/filament-api/license.svg)](https://packagist.org/packages/tomatophp/filament-api)\n[![Downloads](https://poser.pugx.org/tomatophp/filament-api/d/total.svg)](https://packagist.org/packages/tomatophp/filament-api)\n\nGenerate APIs from your filament resource using single line of code\n\n## Installation\n\nmake sure that you have SQLite3 Driver installed on your PHP config, because this package required it for caching.\n\n```bash\ncomposer require tomatophp/filament-api\n```\n\nif you want to use API Resource to list your generated APIs you can register the plugin on `/app/Providers/Filament/AdminPanelProvider.php`\n\n```php\n-\u003eplugin(\\TomatoPHP\\FilamentApi\\FilamentAPIPlugin::make())\n```\n\n## Screenshots\n\n![APIs Resource](https://raw.githubusercontent.com/tomatophp/filament-api/master/arts/api-resource.png)\n\n## Usage\n\nyou can generate API by add this trait to your resource pages\n\n```php\nuse TomatoPHP\\FilamentApi\\Traits\\InteractWithAPI;\nuse \\Filament\\Resources\\Pages\\ListRecords;\n\nclass ListPosts extends ListRecords\n{\n    use InteractWithAPI;\n}\n```\n\nand that's it you can now access your API by `/api/{slug}`\n\nwe provide 5 methods:\n\n- GET `/api/{slug}` to list all records `support searching by use search=`\n- GET `/api/{slug}/{id}` to get single record\n- POST `/api/{slug}` to create new record\n- PUT `/api/{slug}/{id}` to update record\n- DELETE `/api/{slug}/{id}` to delete record\n\n## Custom your API\n\nyou can customize your api by override this methods\n\n```php\n// Use to return API JSON Resource on Index/Show/Store/Update\npublic static function getFilamentAPIResource(): ?string\n{\n    return null;\n}\n\n// Use To Custom Your Route Middleware\npublic static function getFilamentAPIMiddleware(): array\n{\n    return config('filament-api.default_middleware');\n}\n\n// Use To Change the Endpoint Slug\npublic static function getFilamentAPISlug(): ?string\n{\n    return null;\n}\n```\n\n## Publish Assets\n\nyou can publish config file by use this command\n\n```bash\nphp artisan vendor:publish --tag=\"filament-api-config\"\n```\n\n## Other Filament Packages\n\ncheckout our [Awesome TomatoPHP](https://github.com/tomatophp/awesome)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomatophp%2Ffilament-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomatophp%2Ffilament-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomatophp%2Ffilament-api/lists"}