You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,This problem has been bothering me.Because it still exists in multiple versions.
When I try to call the paginate() method at the end of the model, the return value it gives me should be Illuminate\Pagination\LengthAwarePaginator Instead of \Illuminate\Contracts\Pagination\LengthAwarePaginator defined in _ide_helper.php, Although this should not seem too much of a problem, because \Illuminate\Contracts\Pagination\LengthAwarePaginator implements Illuminate\Contracts\Support\Arrayable which makes it possible to call the toArray method after paginate() Serialize, then modify the data column inside, although it is now working, but in PHPStorm will show the exception highlighting of the method does not exist.
Because I know this may not be a bug, or because of some features such as Contracts, so I didn't intend to submit a pull request, so I would like to ask if I can solve this problem.
Of course, I do this because I need to modify the data in the return value of paginate() and keep the original paging data structure. Maybe you can have better.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further.
Thank you for your contribution! Apologies for any delayed response on our side.
I think this is a feature of the Laravel container, because here is only the return value declared as an interface, it is really impossible to know which specific object the interface is bound to behind the container, so the type hint here directly uses the interface, it should be Correct, but I need to do another treatment in the IDE prompt of my project.
Perhaps this extension should be able to do the same.
Hi,This problem has been bothering me.Because it still exists in multiple versions.
When I try to call the paginate() method at the end of the model, the return value it gives me should be
Illuminate\Pagination\LengthAwarePaginator
Instead of\Illuminate\Contracts\Pagination\LengthAwarePaginator
defined in_ide_helper.php
, Although this should not seem too much of a problem, because\Illuminate\Contracts\Pagination\LengthAwarePaginator
implementsIlluminate\Contracts\Support\Arrayable
which makes it possible to call thetoArray
method after paginate() Serialize, then modify the data column inside, although it is now working, but in PHPStorm will show the exception highlighting of the method does not exist.Because I know this may not be a bug, or because of some features such as
Contracts
, so I didn't intend to submit a pull request, so I would like to ask if I can solve this problem.Of course, I do this because I need to modify the data in the return value of paginate() and keep the original paging data structure. Maybe you can have better.

The text was updated successfully, but these errors were encountered: