{"id":34758526,"url":"https://github.com/cerbero90/json-api-error","last_synced_at":"2026-05-09T07:32:40.434Z","repository":{"id":225050277,"uuid":"764916149","full_name":"cerbero90/json-api-error","owner":"cerbero90","description":"💥 Laravel package to standardize API errors in compliance with the JSON:API spec.","archived":false,"fork":false,"pushed_at":"2024-03-12T23:18:17.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-02T04:22:43.329Z","etag":null,"topics":["api","error-handling","json","json-api","laravel"],"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/cerbero90.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","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":"cerbero90","ko_fi":"cerbero90"}},"created_at":"2024-02-29T00:01:02.000Z","updated_at":"2024-05-27T15:35:24.503Z","dependencies_parsed_at":"2024-03-11T23:34:05.748Z","dependency_job_id":"9dd3b4dd-709a-46cd-a0b5-2cbb9945bb66","html_url":"https://github.com/cerbero90/json-api-error","commit_stats":null,"previous_names":["cerbero90/json-api-error"],"tags_count":9,"template":false,"template_full_name":"cerbero90/skeleton","purl":"pkg:github/cerbero90/json-api-error","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerbero90%2Fjson-api-error","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerbero90%2Fjson-api-error/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerbero90%2Fjson-api-error/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerbero90%2Fjson-api-error/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cerbero90","download_url":"https://codeload.github.com/cerbero90/json-api-error/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cerbero90%2Fjson-api-error/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32811340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","error-handling","json","json-api","laravel"],"created_at":"2025-12-25T05:48:48.625Z","updated_at":"2026-05-09T07:32:40.428Z","avatar_url":"https://github.com/cerbero90.png","language":"PHP","funding_links":["https://github.com/sponsors/cerbero90","https://ko-fi.com/cerbero90"],"categories":[],"sub_categories":[],"readme":"# 💥 JSON:API Error\n\n[![Author][ico-author]][link-author]\n[![PHP Version][ico-php]][link-php]\n[![Laravel Version][ico-laravel]][link-laravel]\n[![Build Status][ico-actions]][link-actions]\n[![Coverage Status][ico-scrutinizer]][link-scrutinizer]\n[![Quality Score][ico-code-quality]][link-code-quality]\n[![PHPStan Level][ico-phpstan]][link-phpstan]\n[![Total Downloads][ico-downloads]][link-downloads]\n[![Latest Version][ico-version]][link-packagist]\n[![Software License][ico-license]](LICENSE.md)\n[![PER][ico-per]][link-per]\n\n```json\n{\n  \"errors\": [\n    {\n      \"status\": \"422\",\n      \"title\": \"Unprocessable Content\",\n      \"detail\": \"The name field must be a string.\",\n      \"source\": {\n        \"pointer\": \"/name\"\n      }\n    },\n    {\n      \"status\": \"422\",\n      \"title\": \"Unprocessable Content\",\n      \"detail\": \"The name field must be at least 2 characters.\",\n      \"source\": {\n        \"pointer\": \"/name\"\n      }\n    }\n  ]\n}\n```\n\nLaravel package to standardize API error responses in compliance with the [JSON:API spec](https://jsonapi.org/examples/#error-objects), providing:\n\n- **consistency**: ensure uniform API error responses across all Laravel apps, adhering to a widely used standard\n- **automation**: handle Laravel-specific and common HTTP exceptions automatically\n- **simplicity**: focus solely on error responses without the need to implement the full JSON:API spec\n- **zero configuration**: install the package with no additional configuration required\n- **customization**: optionally register custom handlers, map errors to HTTP statuses or merge default data\n- **localization**: translate JSON:API errors into any language\n- **testability**: test error responses using the built-in testing tools\n- **debugging**: inspect the original message and trace when an unexpected error occurs\n\n\n## 📦 Install\n\nVia Composer:\n\n``` bash\ncomposer require cerbero/json-api-error\n```\n\n## 🔮 Usage\n\n\u003e [!NOTE]\n\u003e Work in progress... 🏗️\n\u003e - implement `links`\n\u003e - write documentation\n\u003e - reach 100% code coverage\n\u003e - tag stable version\n\n## 📆 Change log\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## 🧪 Testing\n\n``` bash\ncomposer test\n```\n\n## 💞 Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) and [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for details.\n\n## 🧯 Security\n\nIf you discover any security related issues, please email andrea.marco.sartori@gmail.com instead of using the issue tracker.\n\n## 🏅 Credits\n\n- [Andrea Marco Sartori][link-author]\n- [All Contributors][link-contributors]\n\n## ⚖️ License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n[ico-author]: https://img.shields.io/badge/author-cerbero90-blue?logo=x\u0026style=flat-square\u0026logoSize=auto\n[ico-php]: https://img.shields.io/packagist/php-v/cerbero/json-api-error?color=%23767bb5\u0026logo=php\u0026style=flat-square\u0026logoSize=auto\n[ico-laravel]: https://img.shields.io/static/v1?label=laravel\u0026message=%E2%89%A59.0\u0026color=ff2d20\u0026logo=laravel\u0026style=flat-square\u0026logoSize=auto\n[ico-version]: https://img.shields.io/packagist/v/cerbero/json-api-error.svg?label=version\u0026style=flat-square\n[ico-actions]: https://img.shields.io/github/actions/workflow/status/cerbero90/json-api-error/build.yml?branch=master\u0026style=flat-square\u0026logo=github\u0026logoSize=auto\n[ico-license]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square\n[ico-per]: https://img.shields.io/static/v1?label=compliance\u0026message=PER\u0026color=blue\u0026style=flat-square\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/cerbero90/json-api-error.svg?style=flat-square\u0026logo=scrutinizer\u0026logoSize=auto\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/cerbero90/json-api-error.svg?style=flat-square\u0026logo=scrutinizer\u0026logoSize=auto\n[ico-phpstan]: https://img.shields.io/badge/level-max-success?style=flat-square\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGb0lEQVR42u1Xe1BUZRS/y4Kg8oiR3FCCBUySESZBRCiaBnmEsOzeSzsg+KxYYO9dEEftNRqZjx40FRZkTpqmOz5S2LsXlEZBciatkQnHDGYaGdFy1EpGMHl/p/PdFlt2rk5O+J9n5nA/vtf5ned3lnlISpRhafBlLRLHCtJGVrB/ZBDsaw2lUqzReGAC46DstTYfnSCGUjaaDvgxACo6j3vUenNdImeRXqdnWV5az5rrnzeZznj8J+E5Ftsclhf3s4J4CS/oRx5Bvon8ZU65FGYQxAwcf85a7CeRz+C41THejueydCZ7AAK34nwv3kHP/oUKdOL4K7258fF7Cud427O48RQeGkIGJ77N8fZqlrcfRP4d/x90WQfHXLeBt9dTrSlwl3V65ynWLM1SEA2qbNQckbe4Xmww10Hmy3shid0CMcmlEJtSDsl5VZBdfAgMvI3uuR+moJq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XoHIP8DXL2b+wjdWeXh6U2FjmIIKmbWAYPFRMus62h/geIvjOQYlpuDysQrLL6Ger49HgW8jqvXUhI7UvDb9iaSTDqHtyItiF5Suw5ewF/Nd8VJ6zlhsn06bEhwX4NyfCvuGEeRpTmh4mkG68yDpyuzB9EUcjU5awbAgncPlAeSdAQER0zCndzqVbeXC4qDsMpvGEYBXRnsDx4N3Auf1FCTjTIaVtY/QTmd0I8bBVm1kejEubUfO01vqImn3c49X7qpeqI9inIgtbpxK3YrKfIJCt+OeV2nfUVFR4ca4EkVENyA7gkYcMfB1R5MMmxZ7ez/2KF5SSN1yV+158UPsJT0ZBcI2bRLtIXGoYu5FerOUiJe1OfsL3XEWH43l2KS+iJF9+S4FpcNgsc+j8cT8H4o1bfPg/qkLt50uJ1RzdMsGg0UqwfEN114Pwb1CtWTGg+Y9U5ClK9x7xUWI7BI5VQVp0AVcQ3bZkQhmnEgdHhKyNSZe16crtBIlc7sIb6cRLft2PCgoKGjijBDtjrAQ7a3EdMsxzIRflAFIhPb6mHYmYwX+WBlPQgskhgVryyJCQyNyBLsBQdQ6fgsQhyt6MSOOsWZ7gbH8wETmgRKAijatNL8Ngm0xx4tLcsps0Wzx4al0jXlI40B/A3pa144MDtSgAAAAAElFTkSuQmCC\u0026logoSize=auto\n[ico-downloads]: https://img.shields.io/packagist/dt/cerbero/json-api-error.svg?style=flat-square\n\n[link-author]: https://twitter.com/cerbero90\n[link-php]: https://www.php.net\n[link-laravel]: https://laravel.com\n[link-packagist]: https://packagist.org/packages/cerbero/json-api-error\n[link-actions]: https://github.com/cerbero90/json-api-error/actions?query=workflow%3Abuild\n[link-per]: https://www.php-fig.org/per/coding-style/\n[link-scrutinizer]: https://scrutinizer-ci.com/g/cerbero90/json-api-error/code-structure\n[link-code-quality]: https://scrutinizer-ci.com/g/cerbero90/json-api-error\n[link-downloads]: https://packagist.org/packages/cerbero/json-api-error\n[link-phpstan]: https://phpstan.org/\n[link-contributors]: ../../contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcerbero90%2Fjson-api-error","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcerbero90%2Fjson-api-error","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcerbero90%2Fjson-api-error/lists"}