BinarCode / laravel-restify

The fastest way to make a powerful JSON:API compatible Rest API with Laravel.
https://restify.binarcode.com
MIT License
604 stars 54 forks source link

feat!: Adapt Restify to JSONAPI standards #582

Closed maicol07 closed 4 days ago

maicol07 commented 1 year ago

Fixes #558 Will fix: #562

Progress:

⚒️ means "Currently in progress"

what-the-diff[bot] commented 1 year ago

PR Summary

binaryk commented 1 year ago

I think you can use the $eagerState property instead of isRelationship.

maicol07 commented 1 year ago

I think you can use the $eagerState property instead of isRelationship.

The issue here is that $eagerState is used for the included (old relationships array). I need something else to identify the new slim relationships array and the included one. Maybe I can use an enum since Restify targets PHP 8.1+?

maicol07 commented 1 year ago

@binaryk I think the PR is ready to be reviewed. The only thing left is a documentation update to cover the new API format (I guess this can be labeled as Restify 9.0?)

There is also a test failing but I don't know how to fix it (I think I need your help for this one :sweat_smile:)! Basically, it seems nested relationships aren't added to included. Related code:

https://github.com/maicol07/laravel-restify/blob/b0da4d86ab16b4ae9d05e118200d799e7213437b/src/Repositories/Repository.php#L542-L553

binaryk commented 11 months ago

Thanks @maicol07 , can we make sure tests pass please?

maicol07 commented 11 months ago

Thanks @maicol07 , can we make sure tests pass please?

Yes, I want the last test to pass, however I tried to debug it but I can't understand why nested relationships aren't loaded in included. Am I missing something?

netlify[bot] commented 8 months ago

Deploy Preview for laravel-restify-docs canceled.

Name Link
Latest commit 3feefd12f37568f602c2f5445575d4071a50c4b0
Latest deploy log https://app.netlify.com/sites/laravel-restify-docs/deploys/65f191f1979b3800081247b1
binaryk commented 4 days ago

@maicol07 I'll have to close this due to inactivity. Now we're on branch 9.x. Please let us know if you want to support it further.