{"id":21074660,"url":"https://github.com/javierxhernandez/jsonapi","last_synced_at":"2026-05-18T15:36:52.197Z","repository":{"id":219866033,"uuid":"544148642","full_name":"JavierxHernandez/jsonapi","owner":"JavierxHernandez","description":"Laravel - Created a api with JSON:API specification","archived":false,"fork":false,"pushed_at":"2022-11-19T18:40:46.000Z","size":121,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-16T02:58:47.825Z","etag":null,"topics":["api","json-api","laravel","rest","tdd"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JavierxHernandez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-10-01T19:18:57.000Z","updated_at":"2024-02-28T22:07:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"097a1b53-abe1-47d5-9517-986dc9ee55b6","html_url":"https://github.com/JavierxHernandez/jsonapi","commit_stats":null,"previous_names":["javierxhernandez/jsonapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JavierxHernandez/jsonapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JavierxHernandez%2Fjsonapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JavierxHernandez%2Fjsonapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JavierxHernandez%2Fjsonapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JavierxHernandez%2Fjsonapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JavierxHernandez","download_url":"https://codeload.github.com/JavierxHernandez/jsonapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JavierxHernandez%2Fjsonapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33183188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","json-api","laravel","rest","tdd"],"created_at":"2024-11-19T19:17:12.164Z","updated_at":"2026-05-18T15:36:52.192Z","avatar_url":"https://github.com/JavierxHernandez.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Notes\n## Blueprint Install in dev\n\ncomposer require laravel-shift/Blueprint --dev\n\n## Generate the Blueprint file to set up the model scheme\n\nphp artisan blueprint:new\n\n## Edit Blueprint Config\n\nphp artisan vendor:publish \n\n'use_constraints' =\u003e true\n'use_guarded' =\u003e true\n\n## Blueprint build\n\nphp artisan blueprint:build\n\nNote: In real projects is recommended set in the git ignore the \".blueprint\" and \"draft.yaml\" file.\n\n## Modified the example test structure with stub\n\nphp artisan stub:publish\n\n## Resource\n\nphp artisan make:resource ArticleResource\n\nNote: Is use to formatter the resource with the structure api:json out of the controller.\n\n## Api Prefix\n\nThis is changed in the RouteServiceProvider.\n\n## Create a ResourceCollection with:\n\nphp artisan make:resource ArticleCollection\n\nnote: When using resources of type \"resource and collection\" there is a convention when creating them. You must use the singular name in the 2 files to form a relationship so you can use the $this-\u003ecollection to call the \"resource\" in the \"collection\". In the case that these names are different, a $collects will be added.\n\n## Header validation Json:api\n\nphp artisan make:middleware ValidateJsonApiHeaders\nNote: The middleware for routes is configured in the App Kernel.\n\n(Request): GET | POST | PATCH | DELETE\nsent: accept application/vnd.api+json\nOr get: 406 Not Acceptable\n\nIn POST | PATCH | DELETE\nAdd: content-type application/vnd.api+json\nOr get: 415 Unsupported Media Type\n\n(Responses)\ncontent-type application/vnd.api+json\n\n## Testing Helpers\n\nFirst I created the trait to add the headers in the test requests and use them in the testCase. this prevented errors in the json call request in the tests.\n\n## Json api validation error response\n\n\"errors\": {\n    \"title\": \"Invalid data\",\n    \"detail\": \"Title is required\",\n    \"source\": [\n        \"pointer\": \"/data/attributes/title\"\n    ]\n}\n\n## Testing response helpers\n\nThe good practice for adding macros is to create a new service provider and implement in the boot method inside it.\n\nphp artisan make:provider JsonApiServiceProvider\n\nand configure the new provider inside config/app.php in the providers section.\n\n## Validating JSON:API Document\n\n## Custom error response\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavierxhernandez%2Fjsonapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavierxhernandez%2Fjsonapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavierxhernandez%2Fjsonapi/lists"}