diff --git a/app/Models/OldEchomail.php b/app/Models/OldEchomail.php deleted file mode 100644 index 2392ac8..0000000 --- a/app/Models/OldEchomail.php +++ /dev/null @@ -1,78 +0,0 @@ - 'json' ]; - - private const cast_utf8 = [ - 'to', - 'from', - 'subject', - 'msg', - 'origin', - 'tearline', - 'tagline', - ]; - protected $dates = ['datetime']; - - public static function resolveConnection($connection = null) - { - return static::$resolver->connection('mongodb'); - } - - /* RELATIONS */ - - public function echoarea() - { - return $this->belongsTo(Echoarea::class); - } - - public function fftn() - { - return $this - ->setConnection('pgsql') - ->belongsTo(Address::class) - ->withTrashed(); - } - - /* ATTRIBUTES */ - - public function getKludgesAttribute(?string $value): Collection - { - return collect($this->castAttribute('kludges',$value)); - } - - public function getPathAttribute(?array $value): Collection - { - if (is_null($value)) - return collect(); - - return Address::whereIn('id',$value) - ->orderBy(DB::raw(sprintf("position (id::text in '(%s)')",join(',',$value)))) - ->get(); - } - - public function getSeenByAttribute(?array $value): Collection - { - if (is_null($value)) - return collect(); - - return Address::whereIn('id',$value)->get(); - } -} \ No newline at end of file