2017 © Pedro Peláez
 

library jad

Json Api to Doctrine ORM

image

oligus/jad

Json Api to Doctrine ORM

  • Friday, March 9, 2018
  • by oligus
  • Repository
  • 6 Watchers
  • 13 Stars
  • 245 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 5 Open issues
  • 19 Versions
  • 13 % Grown

The README.md

JAD

JSON Api :heart: Doctrine ORM, (*1)

Build Status License: MIT Codecov.io Maintainability, (*2)

JAD is a library created for rapid development of JSON API backend REST implementation. You can run JAD as a standalone server with php -S (see demo), or you can use it as a middleware in your framework., (*3)

It turns doctrine entities (doctrine/doctrine2) to a JSON API resource, or collection of resources automagically., (*4)

Requirements

You need to have Doctrine installed and preferably setup before you can use Jad., (*5)

Install

composer require oligus/jad, (*6)

Quick start

  1. Annotate your entities that you want to expose to JSON-API:
/**
 * @ORM\Entity
 * @ORM\Table(name="albums")
 * @Jad\Map\Annotations\Header(type="albums")
 */
class Albums
{
...
  1. Setup JAD using current entity manager.
$jad = new Jad(new Jad\Map\AnnotationMapper($em));
$jad->setPathPrefix('/api/v1/jad');
$jad->jsonApiResult();
  1. Fetch results
GET /api/v1/jad/albums

Contents

Configure, (*7)

Mapping your entities, (*8)

Fetching the resources, (*9)

Fetching resources with relationships, (*10)

Creating a new resource, (*11)

Updating a resource, (*12)

Deleting resources / relationships, (*13)

Validation, (*14)

Support

Lumen

Support for lumen via middleware., (*15)

In your Lumen bootstrap file (../lumen/bootstrap/app.php), (*16)

// Jad middleware
$app->middleware([
    'jad' => Jad\Support\Lumen\JadMiddleWare::class,
]);

...

// Register Service Providers
$app->register(Jad\Support\Lumen\JadServiceProvider::class);

You can go with the default configuration or copy lumen/vendor/oligus/jad/src/Support/Lumen/jad.php to /lumen/config and change it there., (*17)

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue before making a pull request., (*18)

Authors

  • Oli Gustafsson - Initial work - oligus

License

This project is licensed under the MIT License - see the LICENSE file for details, (*19)

The Versions

09/03 2018

dev-master

9999999-dev

Json Api to Doctrine ORM

  Sources   Download

MIT GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

12/01 2018

v1.1.3

1.1.3.0

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

15/12 2017

v1.1.2

1.1.2.0

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

30/11 2017

v1.1.1

1.1.1.0

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

26/11 2017

v1.1.0

1.1.0.0

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

23/11 2017

v1.0.10

1.0.10.0

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

23/11 2017

v1.0.9

1.0.9.0

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

22/11 2017

v1.0.8

1.0.8.0

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

21/11 2017

v1.0.7

1.0.7.0

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

21/11 2017

v1.0.6-beta

1.0.6.0-beta

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

21/11 2017

v1.0.5-beta

1.0.5.0-beta

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

20/11 2017

v1.0.4-beta

1.0.4.0-beta

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

17/11 2017

v1.0.3-beta

1.0.3.0-beta

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

13/11 2017

v1.0.2-beta

1.0.2.0-beta

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

09/11 2017

v1.0.1-beta

1.0.1.0-beta

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

07/09 2017

v1.0.0-beta

1.0.0.0-beta

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

06/09 2017

dev-add-code-of-conduct-1

dev-add-code-of-conduct-1

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

25/06 2017

v1.0.0-alpha2

1.0.0.0-alpha2

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine

06/06 2017

v1.0.0-alpha

1.0.0.0-alpha

Json Api to Doctrine ORM

  Sources   Download

GPL-2.0

The Requires

 

The Development Requires

by Avatar oligus

orm api json doctrine