Enabled Domain homepage
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
@@ -17,13 +17,5 @@ class Zone extends Model
|
||||
return $this->belongsTo(Domain::class);
|
||||
}
|
||||
|
||||
/* SCOPES */
|
||||
|
||||
/**
|
||||
* Only query active records
|
||||
*/
|
||||
public function scopePublic()
|
||||
{
|
||||
return $this->where('public',TRUE);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user