plugin icon indicating copy to clipboard operation
plugin copied to clipboard

[Bug]: don't detect model properties / cannot find declaration to go..

Open stefanpandele opened this issue 2 years ago • 3 comments

Bug description

Hi,

I just installed laravel idea on phpstorm 2023.2.3 on an existing laravel project.

I went to Laravel -> Generate Helper Code I still have underlined the 'id' in the following query:

  $mainProvider = MainProvider::where('integration_id', ApiController::xxx)->first();
  $provider         = Provider::where('main_provider_id', $mainProvider->id)
                                  ->where('api_name', 'xxx')
                                  ->first();

The methods where & first are detected by the plugin only the property is not detected.

Also I added the property in the model MainProvider and it si no longer underlined in the above code but it returns null as long as the property $id exists in the model. If I coment the property line, it is working as expected.

Thanks!

Plugin version

7.4.3.232

Operating system

MacOS

Steps to reproduce

Laravel -> Generate Helper Code

Relevant log output

No response

stefanpandele avatar Nov 15 '23 10:11 stefanpandele

Hi. This warning is from the Laravel Query plugin. It tries to find this table and field in the PhpStorm's Database tab.

adelf avatar Nov 16 '23 10:11 adelf

Hi. This warning is from the Laravel Query plugin. It tries to find this table and field in the PhpStorm's Database tab.

I do not have any Laravel Query plugin installed. Thanks! Screenshot 2023-11-16 at 22 17 14

stefanpandele avatar Nov 16 '23 20:11 stefanpandele

Sorry, I didn't understand at first. Seems, the plugin couldn't fetch the model table fields. Do you have any logic in the model getTable() method? Do you have migrations for this model? Or used database in the Helper Code generation?

adelf avatar Nov 23 '23 17:11 adelf