{"id":18842435,"url":"https://github.com/firebit/laravel-api-response","last_synced_at":"2025-04-14T07:31:38.973Z","repository":{"id":62504876,"uuid":"213745200","full_name":"firebit/laravel-api-response","owner":"firebit","description":"Simple Laravel package for creating API responses, compliant with JSend and the HTTP standard.","archived":false,"fork":false,"pushed_at":"2020-10-30T10:01:51.000Z","size":9,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T21:12:43.636Z","etag":null,"topics":["api-rest","http-status-code","jsend","laravel","laravel-package"],"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/firebit.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}},"created_at":"2019-10-08T20:19:23.000Z","updated_at":"2020-11-19T11:02:13.000Z","dependencies_parsed_at":"2022-11-02T12:16:29.106Z","dependency_job_id":null,"html_url":"https://github.com/firebit/laravel-api-response","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebit%2Flaravel-api-response","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebit%2Flaravel-api-response/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebit%2Flaravel-api-response/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebit%2Flaravel-api-response/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firebit","download_url":"https://codeload.github.com/firebit/laravel-api-response/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248839406,"owners_count":21169811,"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-rest","http-status-code","jsend","laravel","laravel-package"],"created_at":"2024-11-08T02:54:42.150Z","updated_at":"2025-04-14T07:31:38.638Z","avatar_url":"https://github.com/firebit.png","language":"PHP","readme":"\u003ca href=\"http://firebit.nl/\"\u003e\n    \u003cp align=\"center\"\u003e\n      \u003cimg src=\"https://avatars2.githubusercontent.com/u/49287371?s=200\u0026v=4](https://avatars2.githubusercontent.com/u/49287371?s=200\u0026v=4)\" height=\"100px\" alt=\"Firebit logo\"/\u003e\n    \u003c/p\u003e\n\u003c/a\u003e\n\n# Laravel API Response\nThis package aims to makes responses from the API consistent and easy to use. It is compliant with the HTTP standard and the JSend standard.\n\n## Example\n#### Code\n```php\nfunction getUser($id){\n    // Get the data we wish to return\n    $user = User:find($id);\n    \n    // If the user does not exist we return an error\n    if(!$user){\n        return ApiResponseFactory::notFound(\"User does not exist\");\n    }\n    \n    // Return the data by using a ReponseFactory\n    return ApiResponseFactory::success($user);\n}\n```\n\n#### Error output\n```json\n{\n  \"status\":\"fail\",\n  \"message\":\"User does not exist\"\n}\n```\n\n#### Success output\n```json\n{\n  \"status\":\"success\",\n  \"data\": { \n      \"id\":1,\n      \"name\":\"John Doe\",\n      \"email\":\"john@example.org\",\n      \"created_at\":null,\n      \"updated_at\":null\n  }\n}\n```\n\n\n## Installation\nTo install you can use Composer, use the following command to install this package. \u003cbr/\u003e\n`` composer require firebit/laravel-api-response``\n\n## Documentation\nComing soon!\n\n## Progress\n- [X] JSend compliance\n- [ ] PHPUnit tests\n- [ ] Documentation\n\n## License\nFor the license please check the LICENSE file, this project has the MIT license.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebit%2Flaravel-api-response","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirebit%2Flaravel-api-response","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebit%2Flaravel-api-response/lists"}