pipe-dream / laravel-create

Create Laravel projects really fast
1.31k stars 109 forks source link

Use `new ResourceCollection()` instead of `Resource::collection()` in Resource Pipe. #59

Closed sandulat closed 5 years ago

sandulat commented 5 years ago

Hi guys! Thanks for building such an awesome tool!

I've updated the Resource Pipe to use new ResourceCollection() instead of Resource::collection() since Resource::collection() returns \Illuminate\Http\Resources\Json\AnonymousResourceCollection instead of ResourceCollection. This way any parsers/analyzers/third-party packages could match the types correctly. For example I'm building an automated Laravel API documentation generator, and it would useful to know that it's a ResourceCollection instead of AnonymousResourceCollection.

Sorry I didn't test and didn't build it for now, did the commit directly from GitHub. I'd like to hear your opinion first.

sandulat commented 5 years ago

Oops I've just noticed this: https://trello.com/c/tmQmGLVF/87-commit-stop Should I move this PR somewhere else?

ajthinking commented 5 years ago

Hey @sandulat thanks for the PR!! 😄

Oops I've just noticed this: https://trello.com/c/tmQmGLVF/87-commit-stop

No actually this kind of smaller change is great! The commit stop is more to do focus new features/big fixes in repos of the upcoming version. Explained in https://github.com/pipe-dream/docs.

Ill test and merge in a sec! Thanks 🚀

ajthinking commented 5 years ago

*though we will need to manually lift this PR and others into /laravel-file-factory as well at some point.