laravel-idea / plugin

Laravel Idea plugin for PhpStorm
https://laravel-idea.com/
177 stars 7 forks source link

Issue with Eloquent code completion #1095

Open tvaughan73 opened 1 week ago

tvaughan73 commented 1 week ago

I am migrating an application over to Laravel and have an existing database that does not follow normal naming conventions.
Helper code generates fine but code completion is not working for models. See screenshot below.

image

The model is set up like this:

image

Will this plugin not work when the table is defined in the model?

tvaughan73 commented 1 week ago

is there some kind of limit to the number of models that this will work for? I have 596 models in App\Models and when I remove most of them and generate helper code the code completion works on the models left.

adelf commented 1 week ago

Hello. Yes, the file length is too big.

You can try to fix that by customizing PhpStorm (https://www.jetbrains.com/help/phpstorm/tuning-the-ide.html#configure-platform-properties), but it's better to refactor: move files to the namespaces, like AppModelsAccount, AppModelsShop, etc.

tvaughan73 commented 6 days ago

Hello. Yes, the file length is too big.

You can try to fix that by customizing PhpStorm (https://www.jetbrains.com/help/phpstorm/tuning-the-ide.html#configure-platform-properties), but it's better to refactor: move files to the namespaces, like AppModelsAccount, AppModelsShop, etc.

Hmm, don't think I would want to do that since it would mean refactoring thousands of lines of code. Also, I generated files using barryvdh and it now works fine.

adelf commented 5 days ago

We will reduce the helper code amount. Dramatically. I hope soon.