l5-api icon indicating copy to clipboard operation
l5-api copied to clipboard

[F-REQ] Add withCount same way as `$itemWith` and `$collectionWith`

Open leon0399 opened this issue 6 years ago • 2 comments

Is your feature request related to a problem? Please describe. It's now unable to add counts for relations in API without overriding almost all functions in default Controller at laravel5-api-boilerplate, so it'll be nice to add such functions to this library

Describe the solution you'd like Add a new variable and function to RestfulModel the same way, as $itemWith and $collectionWith: $itemWithCount and $collectionWithCount

Describe alternatives you've considered IMHO, there is no other alternatives

Additional context @specialtactics let me know, if you like this feature, and I'll start working on PR

leon0399 avatar Aug 30 '19 19:08 leon0399

Hi @leon0399 - thanks for your interest.

I've never used that before, but after doing some research, I think it makes sense to add it. If you would like to do a PR to add it, then that's even better :smile:

specialtactics avatar Sep 02 '19 11:09 specialtactics

Sorry, I'm still working on main project with your template :rofl:

I'll contribute asap, when finish the project :smile:

leon0399 avatar Oct 28 '19 17:10 leon0399