Added echomail search and display
This commit is contained in:
@@ -207,6 +207,11 @@ class Address extends Model
|
||||
return sprintf('%s@%s',$this->getFTN4DAttribute(),$this->zone->domain->name);
|
||||
}
|
||||
|
||||
public function getFTN2DAttribute(): string
|
||||
{
|
||||
return sprintf('%d/%d',$this->host_id ?: $this->region_id,$this->node_id);
|
||||
}
|
||||
|
||||
public function getFTN3DAttribute(): string
|
||||
{
|
||||
return sprintf('%d:%d/%d',$this->zone->zone_id,$this->host_id ?: $this->region_id,$this->node_id);
|
||||
|
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Jenssegers\Mongodb\Eloquent\Model;
|
||||
use Jenssegers\Mongodb\Eloquent\SoftDeletes;
|
||||
|
||||
@@ -32,6 +33,18 @@ class Echomail extends Model implements Packet
|
||||
->withTrashed();
|
||||
}
|
||||
|
||||
/* ATTRIBUTES */
|
||||
|
||||
public function getPathAttribute($value): Collection
|
||||
{
|
||||
return Address::whereIn('id',$value)->get()->pluck('ftn3d');
|
||||
}
|
||||
|
||||
public function getSeenByAttribute($value): Collection
|
||||
{
|
||||
return Address::whereIn('id',$value)->get()->pluck('ftn2d');
|
||||
}
|
||||
|
||||
/* METHODS */
|
||||
|
||||
public function jsonSerialize(): array
|
||||
|
Reference in New Issue
Block a user