ldc-web/app/Models/Server.php
2022-12-22 10:36:32 +01:00

51 lines
1,019 B
PHP

<?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;
/**
* 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',
];
/**
* 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'
];
}