If I have a relationship defined on a model, e.g.
class Person extends \Eloquent
{
public function address()
{
return $this->hasMany('App\Addresss');
}
}
I should be able to autocomplete $person->address()->where(... but it doesn't come up. The address() function returns \Illuminate\Database\Eloquent\Relations\HasMany.
You can change the phpdocs for that function if you want.
Ah, OK. So @return Illuminate\Database\Eloquent\Relations\HasMany|Illuminate\Database\Query\Builder seems to work. I think I'm now finding IDE issues, rather than issues with your helper. Thanks!
I could be interesting to change the phpdocs for the methods, but not sure if that is the best way. It would be best fixed in the core..
I created a standalone file supplement to ide-helper, hope it helps you.
https://gist.github.com/zhwei/f13ea35b157d4b8687118e6b40ff30b7
Maintained by Human and Sublime.
@barryvdh tested locally, this works correctly nowadays without any manual work; I vote for closing :}
Most helpful comment
I created a standalone file supplement to ide-helper, hope it helps you.
https://gist.github.com/zhwei/f13ea35b157d4b8687118e6b40ff30b7
Maintained by Human and Sublime.