Method not found in PHP Storm warning
I've read all the threads on this issue already, but to no avail.
I've got a simple HasMany relationship, but PHP Storm fails to find the method withThrashed() on the HasMany Eloquent class. I can add a @method DocBlock to the HasMany class, but I feel it should be done via the laravel-ide-helper composer packager after running php artisan ide-helper:meta, php artisan ide-helper:generate , php artisan ide-helper:eloquent and php artisan ide-helper:models --write or am I missing something?
I've cleared the Laravel caches, compiled classes as well as invalidated the PHP Storm cache and restarted the IDE, but still it show the warning. All ideas are welcome.
public function posts(): HasMany
{
return $this->hasMany(Post::class)
->withTrashed(); // Method not found in PHP Storm warning
}
PHP Storm does not squak at static use of withTrashed():
Post::withTrashed();
Please or to participate in this conversation.