Start of echomail subscribing
This commit is contained in:
@@ -109,6 +109,12 @@ class Address extends Model
|
||||
->with(['zone.domain']);
|
||||
}
|
||||
|
||||
public function echoareas()
|
||||
{
|
||||
return $this->belongsToMany(Echoarea::class)
|
||||
->withPivot(['subscribed']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Who we send this systems mail to.
|
||||
*
|
||||
|
@@ -72,6 +72,14 @@ class System extends Model
|
||||
|
||||
/* METHODS */
|
||||
|
||||
public function echoareas()
|
||||
{
|
||||
return Echoarea::select('echoareas.*')
|
||||
->join('address_echoarea',['address_echoarea.echoarea_id'=>'echoareas.id'])
|
||||
->join('addresses',['addresses.id'=>'address_echoarea.address_id'])
|
||||
->where('addresses.system_id',$this->id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the system's address in the same zone
|
||||
*
|
||||
|
Reference in New Issue
Block a user