I would like to setup a relationship that returns allTenants() for a relationship. Is there a way to do that?
public function holidays() {
// Correctly returns tenant scoped Holidays
return $this->hasMany('Holidays');
}
public function allHolidays() {
// Want all holidays not scoped
return $this->hasMany('Holidays')->allTenants();
// Fails as allTenants() needs to be called statically
}
Also tried
public function allHolidays() {
// Want all holidays not scoped
Holidays::allTenants();
return $this->hasMany('Holidays');
// No error but holidays are still scoped
}
I don't want to Tenant::disable() as I do still want everything else scoped.
I would like to setup a relationship that returns allTenants() for a relationship. Is there a way to do that?
Also tried
I don't want to
Tenant::disable()
as I do still want everything else scoped.