{"id":19199599,"url":"https://github.com/reyesoft/jsonapi-playground","last_synced_at":"2025-06-11T07:09:46.005Z","repository":{"id":89695173,"uuid":"205944321","full_name":"reyesoft/jsonapi-playground","owner":"reyesoft","description":"Laravel JSON:API 1.0 served with Eloquent Models data, schemas and policies.","archived":false,"fork":false,"pushed_at":"2019-09-21T19:37:30.000Z","size":731,"stargazers_count":3,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T05:22:45.982Z","etag":null,"topics":["jsonapi","laravel","playground"],"latest_commit_sha":null,"homepage":"http://jsonapiplayground.reyesoft.com/","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/reyesoft.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":"2019-09-02T22:15:17.000Z","updated_at":"2021-05-22T14:14:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"a73c7a2f-0594-4413-bfd3-a30691b58ec7","html_url":"https://github.com/reyesoft/jsonapi-playground","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reyesoft%2Fjsonapi-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reyesoft%2Fjsonapi-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reyesoft%2Fjsonapi-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reyesoft%2Fjsonapi-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reyesoft","download_url":"https://codeload.github.com/reyesoft/jsonapi-playground/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reyesoft%2Fjsonapi-playground/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259219712,"owners_count":22823577,"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":["jsonapi","laravel","playground"],"created_at":"2024-11-09T12:27:58.928Z","updated_at":"2025-06-11T07:09:45.957Z","avatar_url":"https://github.com/reyesoft.png","language":"PHP","readme":"# JsonApi Playground\n\nFree data service for JSON:API clients testing: \u003chttp://jsonapiplayground.reyesoft.com/\u003e 😁\n\n## Notice\n\nThis example uses a private library (`laravel-json-api`) and purchase is required if you need generate your own data server.\n\n## Resources\n\n- authors\n- books\n- series\n- chapters\n- stores\n- photos\n\n## Development\n\n### Defining a schema for Model\n\n```php\nclass AuthorSchema extends SchemaProvider\n{\n    protected $resourceType = 'authors';\n    public static $policy = AuthorPolicy::class;\n    public static $model = Author::class;\n    protected static $attributes = [];\n    protected static $relationships = [];\n\n    public static function boot(): void {\n        self::addAttribute('name')\n            -\u003esetFilter(StringFilter::class)\n            -\u003esortable();\n        self::addAttribute('birthplace')\n            -\u003esetCru('r');\n        self::addAttribute('date_of_birth');\n        self::addAttribute('date_of_death');\n\n        self::addRelationship(PhotoSchema::class, 'photos')\n            -\u003esetHasMany();\n        self::addRelationship(BookSchema::class, 'books')\n            -\u003esetHasMany();\n    }\n}\n```\n\n#### Explanation\n\n`$policy` define policies for your calls. For example block by user permissions or if user is the owner of resource.\n\n`setFilter(StringFilter::class)` add the possibility to do calls like (more options available)\n \n```\nGET /authors?filter[name]=Ray\nGET /authors?filter[name][eq]=Ray\nGET /authors?filter[name][contains]=Ray\n```\n\n`sortable()` add the possibility to do calls like\n```\nGET /authors?sort=name\nGET /authors?sort=-name\n```\n\n`setCru('r')` you can only read value, you cannot set con Create (c) or Update (u). Default value for CRU parameter is `cru`. \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freyesoft%2Fjsonapi-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freyesoft%2Fjsonapi-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freyesoft%2Fjsonapi-playground/lists"}