laravel-ide-helper
laravel-ide-helper copied to clipboard
How can I have autocompletion for a has many scope usage?
Versions:
- ide-helper Version: 2.10
- Laravel Version: 8.65
- PHP Version: 8.1
Question:
For example if I have this has many relation in User.php
public function profiles()
{
return $this->hasMany(UserProfile::class);
}
UserProfile has this scope
/**
* Scope a query to only include active profiles
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return void
*/
public function scopeActive($query)
{
$query->where('is_active', 1);
}
If I am in User.php and wrote this
$this->profiles->
I don't see a suggestion for active()
As a side note. I am using PHPStorm Appreciate any help
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.