Cast empty Collections to null, Cast strings to zstd compressed strings, add msg_src to echomails processed, fix duplicate seenbys
This commit is contained in:
@@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
use App\Casts\CompressedString;
|
||||
use App\Traits\{QueryCacheableConfig,ScopeActive};
|
||||
|
||||
class Domain extends Model
|
||||
@@ -17,6 +18,10 @@ class Domain extends Model
|
||||
private const CACHE_TIME = 3600;
|
||||
private const STATS_MONTHS = 6;
|
||||
|
||||
protected $casts = [
|
||||
'homepage' => CompressedString::class,
|
||||
];
|
||||
|
||||
/* SCOPES */
|
||||
|
||||
/**
|
||||
@@ -49,12 +54,7 @@ class Domain extends Model
|
||||
public function getHomePageAttribute(string $value): string
|
||||
{
|
||||
//0xFD2FB528
|
||||
return $value ? zstd_uncompress(base64_decode($value)) : 'No available information at the moment.';
|
||||
}
|
||||
|
||||
public function setHomePageAttribute(string $value): void
|
||||
{
|
||||
$this->attributes['homepage'] = base64_encode(zstd_compress($value,9));
|
||||
return $this->castAttribute('homepage',$value) ?: 'No available information at the moment.';
|
||||
}
|
||||
|
||||
/* METHODS */
|
||||
|
Reference in New Issue
Block a user