Open morawcik opened 3 years ago
Can you provide a repository for easily reproducing this? and can you provide the exact command you used there?
Ideally something like:
composer create-project laravel/laravel laravel-ide-helper-issue-1191
Ok. I created fresh install (couple of times to check it) https://github.com/morawcik/test-laravel-ide-helper and it seams that sth with ide-generate:eloquent. My steps:
composer create-project laravel/laravel laravel-ide-helper-issue-1191
User::where('email', 'email@example.com')->first();
to default route in routes/web.phpphp artisan vendor:publish --provider="Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider" --tag=config
php artisan ide-helper:model -M
php artisan ide-helper:generate
php artisan ide-helper:eloquent
Non-static method 'where' should not be called statically, but the class has the '__magic' method.
and command+click points to where in vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php
Ok I see, I think I initially missed the you use ide-helper:eloquent
. IMHO that's quite a bastard comment and should be avoided, as it modifies your vendor files 😢
However, cloning your project I still don't know where I should get this
Non-static method 'where' should not be called statically, but the class has the '__magic' method
I can confirm the CDM-click gives 2 options to me now:
But this is expected in this setup I would say 🤷♀️
Trying to avoid writing the meta data of the models to them brings all this weird issues it seems to me.
I'm also getting this issue when using --write-mixin. Is there a solution?
I get this issue aswell. Have it on all my Eloquent models when calling create or so:
Hi, today after updated Laravel from 8.31.0 to 8.33.1 and Ide-helper from 2.9.0 to 2.9.1 (by composer update) and running all commands (eloquent, generate, meta and models --write-mixin) i'm getting error
for
User::where('email', $email)->first()