plugin icon indicating copy to clipboard operation
plugin copied to clipboard

[Bug]: paginate autocomplete is not working : auth()->user()->products()->paginate(10)

Open beshoo opened this issue 3 years ago • 5 comments

Bug description

Dear support I have a products module that has belongTo relation to the user, and the user module has HasMany relations.

User Module

    public function products()
    {
        return $this->hasMany(Products::class);
    }

Products

    public function user()
    {
        return $this->belongsTo(User::class);
    }

Now in the ProductController

 public function index()
    {
        return response()->json([
            'product_list' => auth()->user()->products()->paginate(10),
        ]);
    } 

It works just fine, but

The autocomplete for the pagination is not available in the menu! image

Plugin version

5.7.3.221

Operating system

Windows

Steps to reproduce

No response

Relevant log output

No response

beshoo avatar Sep 04 '22 12:09 beshoo

image

image

beshoo avatar Sep 05 '22 13:09 beshoo

Hello.

I could reproduce this. It appears only for Auth::user() and similar calls when Laravel Idea helps PhpStorm to understand the type(App/Models/User). I think it's on PhpStorm side. I'll try to create an issue in their bugtracker.

adelf avatar Sep 06 '22 08:09 adelf

Did you report this? @adelf Since it is really annoying that phpstrom dos not follow / understand the type(App/Models/User).

beshoo avatar Sep 15 '22 11:09 beshoo

Hello.

I could reproduce this. It appears only for Auth::user() and similar calls when Laravel Idea helps PhpStorm to understand the type(App/Models/User). I think it's on PhpStorm side. I'll try to create an issue in their bugtracker.

Hello, any updates on this?

theveloperspl avatar May 18 '23 01:05 theveloperspl

Seems it was fixed. PhpStorm 2023.3:

image

adelf avatar Jan 03 '24 13:01 adelf