laravel-query-builder: Call to undefined method
Trying to migrate my project to Laravel 9. After upgrading laravel-query-builder
to version 5.0.0 I get the error:
Call to undefined method Spatie\QueryBuilder\QueryBuilder::allowedAppends()
It seems like there is no more appending attributes point for version 5 as well. Why this feature was removed?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 15 (5 by maintainers)
We felt like this feature didn’t belong in the package and it added too much complexity.
For me, the Feauture appending attributes was very helpful. For example to add computed properties only when needed or allowed by role.
Fortunately you still kept all needed functions in
QueryBuilderRequest
. So I only had to restoreAppendsAttributesToResults
andInvalidAppendQuery
and overwrite__call
fromQueryBuilder
.Is it planned to leave
QueryBuilderRequest
like this? If not, it would be a consideration changing variables likeprivate static $includesArrayValueDelimiter = ',';
toprotected
for easier overwriting?Good to know, maybe update the “changelog” and release notes? Thank you
I followed @wi-wissen suggestion and made a fork.
https://github.com/kurorido/laravel-query-builder/commit/067595efaeacfcb7c91f46df5f878ddce3cd9fb6
@TheFrankman This is how I solved it for now. I’ll update this comment if I find some conflicts in my app. But it seems to work fine for now, with plain
->get()
aswell as->paginate()
.Updated more complex API function:
That is a great pity that the functionality has been removed. This is important for me in some respects. Now I’ll probably have to work with not so nice workarounds.
@kurorido how did you install the fork? Composer wouldn’t allow me to install it, because the branch name
"Invalid version string "main"
Update: Could solve it using
and
"spatie/laravel-query-builder": "dev-restore_append"