-
Notifications
You must be signed in to change notification settings - Fork 418
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
Undefined method 'listings'. [{ "resource": "/c:/xampp/htdocs/laraf/app/Http/Controllers/ListingController.php", "owner": "_generated_diagnostic_collection_name_#1", "code": "1013", "severity": 8, "message": "Undefined method 'listings'.", "source": "intelephense", "startLineNumber": 98, "startColumn": 11, "endLineNumber": 98, "endColumn": 19 }] #13
Comments
I am facing the same issue/errors? Any fix for that? I tried Laravel Docs, stackoverflow etc. |
It seems to have fixed the problem when I replaced ' auth()->user()->listings()->get() ' to 'request()->user()->listings()->get()'. |
I have solved that issue by changing the access modifier of the listings() method from protected function listings (){ |
Yes, for now,
the request () is the best solution to the problem.
…On Sat, Aug 20, 2022, 8:22 PM TechNech ***@***.***> wrote:
It seems to have fixed the problem when I replaced '
auth()->user()->listings()->get() ' to
'request()->user()->listings()->get()'.
—
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2LL5INP2I4VN336HLNG5OLV2EV6DANCNFSM56WK3VLQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
When you use the request() method in place of auth(), the error will
disappear.
On Sun, Oct 9, 2022, 4:16 PM Iorawua. H Francis ***@***.***>
wrote:
… Yes, for now,
the request () is the best solution to the problem.
On Sat, Aug 20, 2022, 8:22 PM TechNech ***@***.***> wrote:
> It seems to have fixed the problem when I replaced '
> auth()->user()->listings()->get() ' to
> 'request()->user()->listings()->get()'.
>
> —
> Reply to this email directly, view it on GitHub
> <#13 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/A2LL5INP2I4VN336HLNG5OLV2EV6DANCNFSM56WK3VLQ>
> .
> You are receiving this because you modified the open/close state.Message
> ID: ***@***.***>
>
|
Where exactly? I have the modifier public and it's still not working. |
Even if public function listings() is in User table the listings() method shows as undefined in listingcontroller.php |
Undefined method 'listings'.intelephense(P1013): I just ignored it.
|
Mine too is working fine, despite the error message
…On Sun, Dec 17, 2023, 11:00 AM karizmaj ***@***.***> wrote:
Undefined method 'listings'.intelephense(P1013):
Seems like the plugin is just not recognizing the function, but it still
works fine.
I just ignored it.
/** @Disregard */
return view('listings.manage', [
'listings' => auth()->user()->listings()->paginate() //intellephense marks this as an error but it works
]);
—
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2LL5IIGG4TRZNM2MIXXNATYJ27FHAVCNFSM56WK3VL2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBVHEYDSNRVHEYQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
i am having issue with this line of code "return view('listings.manage', ['listings' => auth()->user()->listings()->get()]);". i try replacing it with the one on github but it still not working.
The text was updated successfully, but these errors were encountered: