Improves server model and cleans up model code calls.
This commit is contained in:
parent
b1389262e2
commit
02458c909d
8 changed files with 71 additions and 80 deletions
|
@ -52,4 +52,15 @@ class Allocation extends Model
|
|||
'port' => 'integer',
|
||||
'server_id' => 'integer',
|
||||
];
|
||||
|
||||
/**
|
||||
* Accessor to automatically provide the IP alias if defined.
|
||||
*
|
||||
* @param null|string $value
|
||||
* @return string
|
||||
*/
|
||||
public function getAliasAttribute($value)
|
||||
{
|
||||
return (is_null($this->ip_alias)) ? $this->ip : $this->ip_alias;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue