Closed maartenpaauw closed 1 year ago
Hi @maartenpaauw ,
Thank you for the PR. The code looks good, but could you add tests to prove that the code works?
The project where we use this package has been postponed. As a result, I haven't had time to write tests yet.
Ah alright. For now I've merged this into a separate branch and I'm expanding on it to include some tests. Thank you for your contribution 😄
Description
Add initial support for non-Eloquent resources
Motivation and context
Laravel JSON:API offers support for non-Eloquent resources. This PR add initial support for non-Eloquent resources.
It isn't flawless because, the entity under the hood needs to implement
ArrayAccess
and have staticall
method (which is needed to generate examples). But it's a good start.How has this been tested?
Tests are green and the JSON file is generating.
Screenshots (if appropriate)
Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Checklist:
Go over all the following points, and put an
x
in all the boxes that apply.Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your tests and code style pass.
If you're unsure about any of these, don't hesitate to ask. We're here to help!