You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The User model has the SoftDeletes trait but PhpStorm generates this error:
Method 'withTrashed' not found in \Illuminate\Database\Eloquent\Relations\BelongsTo
Which is totally correct of course, however we all know this does work.
The nice thing is that with Larastan even PHPStan supports it (PR) and I thought that maybe there is a way to teach PhpStorm to handle this too so that autocompletion works correctly on relations.
If it's also possible to get this code working that would be even more cool:
I know this example doesn't make much sense but the gist is that it knows that the user() returns a relation that links to the user model so it knows withTrashed (or any other scope for that matter) is resolved.
If I missed something and this is already supported I'm sorry but I tried with the generated Eloquent code (which is crazy cool) and that did not seem to "fix" it.
Thanks in advance <3
The text was updated successfully, but these errors were encountered:
Hey there, I'm not a 100% sure this is fixable by a plugin but it would be extremely nice if it somehow could...
Considering this code:
The
User
model has theSoftDeletes
trait but PhpStorm generates this error:Method 'withTrashed' not found in \Illuminate\Database\Eloquent\Relations\BelongsTo
Which is totally correct of course, however we all know this does work.
The nice thing is that with Larastan even PHPStan supports it (PR) and I thought that maybe there is a way to teach PhpStorm to handle this too so that autocompletion works correctly on relations.
If it's also possible to get this code working that would be even more cool:
I know this example doesn't make much sense but the gist is that it knows that the
user()
returns a relation that links to the user model so it knowswithTrashed
(or any other scope for that matter) is resolved.If I missed something and this is already supported I'm sorry but I tried with the generated Eloquent code (which is crazy cool) and that did not seem to "fix" it.
Thanks in advance <3
The text was updated successfully, but these errors were encountered: