{"id":19870315,"url":"https://github.com/alphaolomi/json-placeholder","last_synced_at":"2025-05-02T08:31:44.394Z","repository":{"id":126079235,"uuid":"611070080","full_name":"alphaolomi/json-placeholder","owner":"alphaolomi","description":"JSON Placeholder for PHP, A Free fake API for testing and prototyping.","archived":false,"fork":false,"pushed_at":"2024-04-29T10:55:05.000Z","size":48,"stargazers_count":10,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-21T05:14:16.671Z","etag":null,"topics":["jsonplaceholder","php","php-library","sdk"],"latest_commit_sha":null,"homepage":"https://alphaolomi.github.io/json-placeholder/","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/alphaolomi.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"alphaolomi"}},"created_at":"2023-03-08T03:16:47.000Z","updated_at":"2024-08-21T01:04:34.342Z","dependencies_parsed_at":null,"dependency_job_id":"0800cf19-7a3a-4b98-a0f6-136ee8beab2b","html_url":"https://github.com/alphaolomi/json-placeholder","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaolomi%2Fjson-placeholder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaolomi%2Fjson-placeholder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaolomi%2Fjson-placeholder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaolomi%2Fjson-placeholder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alphaolomi","download_url":"https://codeload.github.com/alphaolomi/json-placeholder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252008848,"owners_count":21679649,"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":["jsonplaceholder","php","php-library","sdk"],"created_at":"2024-11-12T16:08:35.346Z","updated_at":"2025-05-02T08:31:44.139Z","avatar_url":"https://github.com/alphaolomi.png","language":"PHP","funding_links":["https://github.com/sponsors/alphaolomi"],"categories":[],"sub_categories":[],"readme":"# Json Placeholder for PHP\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/alphaolomi/json-placeholder.svg?style=flat-square)](https://packagist.org/packages/alphaolomi/json-placeholder)\n[![Tests](https://img.shields.io/github/actions/workflow/status/alphaolomi/json-placeholder/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/alphaolomi/json-placeholder/actions/workflows/run-tests.yml)\n[![Total Downloads](https://img.shields.io/packagist/dt/alphaolomi/json-placeholder.svg?style=flat-square)](https://packagist.org/packages/alphaolomi/json-placeholder)\n\nA PHP SDK for the [JSON Placeholder API](https://jsonplaceholder.typicode.com/).\n\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require alphaolomi/json-placeholder\n```\n\n## Usage\n\n```php\n$api = new Json\\Api();\n\n$users = $api-\u003eusers()-\u003elist();\n\nforeach($users as $user) {\n    echo $user-\u003ename;\n}\n```\n\nShorthand\n\n```php\n$users =  (new Json\\Api())-\u003eusers()-\u003elist();\n\nprint_r($users);\n\n// array:10 [\n//   0 =\u003e array:8 [\n//     \"id\" =\u003e 1\n//     \"name\" =\u003e \"Leanne Graham\"\n//     \"username\" =\u003e \"Bret\"\n//     \"email\" =\u003e \"Sincere@april.biz\"\n//     \"address\" =\u003e array:5 [▶]\n//     \"phone\" =\u003e \"1-770-736-8031 x56442\"\n//     \"website\" =\u003e \"hildegard.org\"\n//     \"company\" =\u003e array:3 [▶]\n//   ]\n//   1 =\u003e array:8 [▶]\n// ]\n```\n\n## Paginated Results\n\nYou may prefer to retrieve all the results from the paginated requests by using the `paginator` method on the SDK.\n\n```php\n$api = new Json\\Api();\n\n$results = $api-\u003eusers()-\u003epaginate();\n\nforeach($results as $result) {\n    // Handle result\n    echo $result-\u003ename;\n}\n```\n\n\n## Available Resources\n\n- Users\n    - List all users\n    - Get a single user\n    - Create a user\n    - Update a user\n    - Delete a user\n    - Paginate users\n\n\n## Testing\n\n\nUsing PestPHP Testing framework, run the following command to execute the tests.\n\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n- [Alpha Olomi](https://github.com/alphaolomi)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphaolomi%2Fjson-placeholder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falphaolomi%2Fjson-placeholder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphaolomi%2Fjson-placeholder/lists"}