-
-
Notifications
You must be signed in to change notification settings - Fork 56
fix: applyScopes method to support Collection #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This pull request fix the issue that when we create a DataTable service from `php artisan datatables:make` command, the service cannot support CollectionDatatable because applyScopes method in Yajra\DataTables\Services\DataTable class only support EloquentBuilder|QueryBuilder|EloquentRelation.
…ble-with-collection-problem fix applyScopes method to support Collection
yajra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good but the static analysis is failing. Can you please make it pass? Thanks!
|
@g3c0d3r5 the latest patch still fails. Thanks! |
|
Oops, sorry for the missing backslash... |
|
Kudos, SonarCloud Quality Gate passed! |
|
Released on v9.1.4 🚀 Thanks! |
|
Hello @yajra, This is a breaking change. Many clients will be 500 errors caused by this PR. Why you accepted a change to the signature in 1 minor version? 🥹 |
|
It should be merged in version 10.x |
|
Oh no, the tests are passing. I will check again and revert if needed. It was already merged in 10.x too. |
|
I've updated it by myself 🥲 @yajra do not revert 🥶 |
|
Can you provide some snippets to reproduce your issue? Might also cause issue on others. |
|
Oh, I think you are extending to your own service class. An isolated case I guess. |
|
@yajra I just extended |
|
That makes sense, sorry for the trouble. But it's a needed fix. |
|
@dinhquochan sorry in advance again and heads up. On v10 I will update the stub again to allow AnonymousResourceCollection. See #170 |









This pull request fix the issue that when we create a DataTable service from php artisan datatables:make command, the service cannot support CollectionDatatable because applyScopes method in Yajra\DataTables\Services\DataTable class only support EloquentBuilder|QueryBuilder|EloquentRelation.