barryvdh / laravel-ide-helper

IDE Helper for Laravel
MIT License
14.21k stars 1.16k forks source link

Undefined method 'withQueryString' #1278

Open pixieaka opened 2 years ago

pixieaka commented 2 years ago

Versions:

Description:

Undefined method 'withQueryString'.intelephense(1013)

image image

Steps To Reproduce:

Just fresh Laravel app

fahmiegerton commented 2 years ago

Any update with this issue? Got the same problem unfortunately :(

chathurakodikara commented 2 years ago

I have got the same problem.

AGuyNamedJens commented 2 years ago

Same issue here

abdobouna commented 2 years ago

Same issue here as well.

mankowitz commented 2 years ago

me too.

dgurak commented 2 years ago

Same for me

widdydev commented 2 years ago

+1

febryntara commented 2 years ago

wow, today 25 may 2022 and still face this problem

shantiwebsolution commented 2 years ago

+1

willymac1507 commented 2 years ago

+1

MooseSaeed commented 2 years ago

Same issue

AGuyNamedJens commented 2 years ago

It's been 6 months, time to get a different plugin i guess

phojie commented 1 year ago

🔴 Problem

🟢 Solution

here's how:


$users =  User::query()
           ->paginate(15)
           ->appends($request->all());

other way:

->appends(['search' => $request->search]);

->appends($request->only('search'));

🔗 Reference

Temepest74 commented 1 year ago

Another way to fix this, which works if you don't have acces to the request object anymore

        /**@var LengthAwarePaginator */
        $paginate = User::query()->paginate(10);
        return $paginate->withQueryString();
manning390 commented 1 year ago

Has same problem with toArray due to it returning the contract and not the class which implements the Arrayable interface. Mentioned in #741. The solution above does work. Just mentioning for fellow travelers.

hasan-ozbey commented 7 months ago

The same issue persists.

I'm going with https://github.com/barryvdh/laravel-ide-helper/issues/1278#issuecomment-1551013786 for now.

adrianaditech commented 3 months ago

Same issue. I use this all the time which works perfectly fine and is part of Laravel: $locations = ClinicLocation::onlyTrashed()->paginate($perPage)->withQueryString(); but VS Code shows Undefined Method. image

Other times (even in the same file!) it has no problems: image

Adesin-fr commented 2 months ago

Still facing this issue !

sergey-k1 commented 1 week ago

Don't use the method query() image