{"id":18345114,"url":"https://github.com/gxiang314/php-api","last_synced_at":"2026-04-29T17:03:08.205Z","repository":{"id":227349626,"uuid":"771171273","full_name":"GXiang314/php-api","owner":"GXiang314","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-08T12:37:20.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T13:39:51.499Z","etag":null,"topics":["backend","composer","dotenv","php","restful-api"],"latest_commit_sha":null,"homepage":"","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/GXiang314.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-12T20:18:26.000Z","updated_at":"2025-04-08T12:37:24.000Z","dependencies_parsed_at":"2025-03-27T23:34:17.685Z","dependency_job_id":null,"html_url":"https://github.com/GXiang314/php-api","commit_stats":null,"previous_names":["gxiang314/php-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GXiang314%2Fphp-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GXiang314%2Fphp-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GXiang314%2Fphp-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GXiang314%2Fphp-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GXiang314","download_url":"https://codeload.github.com/GXiang314/php-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248121637,"owners_count":21051169,"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":["backend","composer","dotenv","php","restful-api"],"created_at":"2024-11-05T21:07:17.136Z","updated_at":"2026-04-29T17:03:03.156Z","avatar_url":"https://github.com/GXiang314.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP simplest API Template\n\n## Prerequisite\n\n- php version: `8+`\n- composer installed\n\n\n## Quick start\n\ncopy .env.example to .env\n\n```shell\ncp .env.example .env\n```\n\ninstall packages\n\n```shell\ncomposer install\ncomposer start # running php server on http://localhost:8000\n```\n\n## api response demo\n\n\u003chttp://localhost:8000/api/demo\u003e\n\n```json\n{\n  \"code\": 200,\n  \"data\": [\n    {\n      \"id\": 1,\n      \"name\": \"John\"\n    },\n    {\n      \"id\": 2,\n      \"name\": \"Allen\"\n    }\n  ],\n  \"message\": \"\",\n  \"execution_time\": \"10.347ms\"\n}\n```\n\n## route register\n\n```php\n# ./src/index.php\n# callback function\nuse demo\\decorators\\Param;\n$app-\u003erouter-\u003eget('/path/{id}', fn(#[Param('id')] string $id) =\u003e ['id' =\u003e $id]);\n\n\n# class method\nuse demo\\modules\\demo\\DemoController;\n$app-\u003erouter-\u003epost('path', [DemoController::class, 'methodName'])\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgxiang314%2Fphp-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgxiang314%2Fphp-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgxiang314%2Fphp-api/lists"}