Enabled Domain homepage

This commit is contained in:
Deon George
2021-06-14 21:33:18 +10:00
parent a3b4214040
commit 4011b2a82d
13 changed files with 205 additions and 70 deletions

View File

@@ -10,10 +10,32 @@ class Domain extends Model
{
use ScopeActive;
/* SCOPES */
/**
* Only query active records
*/
public function scopePublic($query)
{
return $query->where('public',TRUE);
}
/* RELATIONS */
public function zones()
{
return $this->hasMany(Zone::class);
}
/* CASTS */
public function getHomePageAttribute($value)
{
return $value ? gzuncompress(base64_decode($value)) : 'No available information at the moment.';
}
public function setHomePageAttribute($value)
{
$this->attributes['homepage'] = base64_encode(gzcompress($value,9));
}
}