2022-09-21 11:17:58 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use App\Enums\Environment;
|
|
|
|
|
use App\Enums\ServerType;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Kwaadpepper\Enum\Traits\CastsEnums;
|
|
|
|
|
|
|
|
|
|
class Server extends Model
|
|
|
|
|
{
|
|
|
|
|
use CastsEnums;
|
|
|
|
|
|
2022-12-22 10:36:32 +01:00
|
|
|
/**
|
|
|
|
|
* The attributes that should be cast.
|
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'virtual_ip' => 'encrypted',
|
|
|
|
|
'ssh' => 'encrypted',
|
|
|
|
|
'infraweb_ip' => 'encrypted',
|
|
|
|
|
'title' => 'encrypted',
|
|
|
|
|
'name' => 'encrypted',
|
|
|
|
|
'function' => 'encrypted',
|
|
|
|
|
'comment' => 'encrypted',
|
|
|
|
|
];
|
|
|
|
|
|
2022-09-21 11:17:58 +00:00
|
|
|
/**
|
|
|
|
|
* Map attribute names to enum classes.
|
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
protected $enumCasts = [
|
|
|
|
|
'env' => Environment::class,
|
|
|
|
|
'type' => ServerType::class
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The attributes that are mass assignable.
|
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'env', 'virtual_ip',
|
|
|
|
|
'ssh', 'infraweb_ip',
|
|
|
|
|
'title', 'name', 'function',
|
|
|
|
|
'comment',
|
|
|
|
|
'type'
|
|
|
|
|
];
|
|
|
|
|
}
|