I created a `HasManyThrough` relationship with unlimited levels: [Repository on GitHub][1]
After the installation, you can use it like this:
<!-- language-all: php -->
class User extends Model {
use \Staudenmeir\EloquentHasManyDeep\HasRelationships;
public function cards() {
return $this->hasManyDeep(Card::class, [Subject::class, Deck::class]);
}
}
[1]: https://github.com/staudenmeir/eloquent-has-many-deep
I created a `HasManyThrough` relationship with unlimited levels: [Repository on GitHub][1]
After the installation, you can use it like this:
<!-- language-all: php -->
class User extends Model {
use \Staudenmeir\EloquentHasManyDeep\HasRelationships;
public function opportunities() {
return $this->hasManyDeep(Opportunity::class, [Client::class, Store::class]);
}
}
[1]: https://github.com/staudenmeir/eloquent-has-many-deep