Improves server model and cleans up model code calls.

This commit is contained in:
Dane Everitt 2017-02-05 19:19:46 -05:00
parent b1389262e2
commit 02458c909d
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
8 changed files with 71 additions and 80 deletions

View file

@ -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;
}
}