{"id":16487731,"url":"https://github.com/oligus/jad","last_synced_at":"2025-03-21T07:31:19.450Z","repository":{"id":57030982,"uuid":"90288618","full_name":"oligus/jad","owner":"oligus","description":"JSON Api to Doctrine","archived":false,"fork":false,"pushed_at":"2021-05-14T22:06:54.000Z","size":886,"stargazers_count":23,"open_issues_count":4,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-01T04:11:40.390Z","etag":null,"topics":["api","automapper","doctrine","json-api","mapper","middleware","rest","rest-api","restful","restful-api"],"latest_commit_sha":null,"homepage":null,"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/oligus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-04T17:04:36.000Z","updated_at":"2023-11-16T08:07:50.000Z","dependencies_parsed_at":"2022-08-23T18:50:36.584Z","dependency_job_id":null,"html_url":"https://github.com/oligus/jad","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oligus%2Fjad","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oligus%2Fjad/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oligus%2Fjad/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oligus%2Fjad/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oligus","download_url":"https://codeload.github.com/oligus/jad/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244120416,"owners_count":20401127,"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","automapper","doctrine","json-api","mapper","middleware","rest","rest-api","restful","restful-api"],"created_at":"2024-10-11T13:35:42.111Z","updated_at":"2025-03-21T07:31:19.018Z","avatar_url":"https://github.com/oligus.png","language":"PHP","readme":"# JAD\n\nJSON Api :heart: Doctrine ORM\n\n[![Build Status](https://travis-ci.org/oligus/jad.svg?branch=master)](https://travis-ci.org/oligus/jad)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Codecov.io](https://codecov.io/gh/oligus/jad/branch/master/graphs/badge.svg)](https://codecov.io/gh/oligus/jad)\n[![Maintainability](https://api.codeclimate.com/v1/badges/db45a4d29b976060fe8a/maintainability)](https://codeclimate.com/github/oligus/jad/maintainability)\n\nJAD is a library created for rapid development of [JSON API](http://jsonapi.org) backend REST implementation. You can\nrun JAD as a standalone server with php -S (see [demo](demo/README.md)), or you can use it as a middleware in your framework.\n\nIt turns doctrine entities ([doctrine/doctrine2](https://github.com/doctrine/doctrine2)) to a JSON API resource, or \ncollection of resources automagically.\n\n## Requirements\n\nYou need to have Doctrine installed and preferably setup before you can use Jad.\n\n## Install\n\n`composer require oligus/jad`\n\n## Quick start\n\n1. Annotate your entities that you want to expose to JSON-API:\n\n```php\n/**\n * @ORM\\Entity\n * @ORM\\Table(name=\"albums\")\n * @Jad\\Map\\Annotations\\Header(type=\"albums\")\n */\nclass Albums\n{\n...\n```\n\n2. Setup JAD using current entity manager. \n\n```php\n$jad = new Jad(new Jad\\Map\\AnnotationMapper($em));\n$jad-\u003esetPathPrefix('/api/v1/jad');\n$jad-\u003ejsonApiResult();\n```\n\n3. Fetch results\n\n``` \nGET /api/v1/jad/albums\n``` \n\n## Contents\n\n[Configure](docs/configure.md)\n\n[Mapping your entities](docs/mapping.md)\n\n[Fetching the resources](docs/fetch.md)\n\n[Fetching resources with relationships](docs/relations.md)\n\n[Creating a new resource](docs/create.md)\n\n[Updating a resource](docs/update.md)\n\n[Deleting resources / relationships](docs/delete.md)\n\n[Validation](docs/validation.md)\n\n## Support\n\n### Lumen\n\nSupport for lumen via middleware.\n\nIn your Lumen bootstrap file (../lumen/bootstrap/app.php)\n```php\n// Jad middleware\n$app-\u003emiddleware([\n    'jad' =\u003e Jad\\Support\\Lumen\\JadMiddleWare::class,\n]);\n\n...\n\n// Register Service Providers\n$app-\u003eregister(Jad\\Support\\Lumen\\JadServiceProvider::class);\n```\n\nYou can go with the default configuration or copy `lumen/vendor/oligus/jad/src/Support/Lumen/jad.php` to `/lumen/config`\nand change it there.\n\n## Contributing\n\nWhen contributing to this repository, please first discuss the change you wish to make via issue before making a pull request.\n\n## Authors\n\n* **Oli Gustafsson** - *Initial work* - [oligus](https://github.com/oligus)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foligus%2Fjad","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foligus%2Fjad","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foligus%2Fjad/lists"}