2025-01-29 12:03:13 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class SslCertificate extends Model
|
|
|
|
|
{
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'ssl_certificate',
|
|
|
|
|
'ssl_private_key',
|
2025-02-04 15:34:24 +00:00
|
|
|
'configuration_dir',
|
2025-02-07 18:36:52 +00:00
|
|
|
'mount_path',
|
2025-01-29 12:03:13 +00:00
|
|
|
'resource_type',
|
|
|
|
|
'resource_id',
|
2025-01-31 11:35:34 +00:00
|
|
|
'server_id',
|
2025-02-03 21:05:32 +00:00
|
|
|
'common_name',
|
|
|
|
|
'subject_alternative_names',
|
2025-01-29 12:03:13 +00:00
|
|
|
'valid_until',
|
2025-02-03 21:05:32 +00:00
|
|
|
'is_ca_certificate',
|
2025-01-29 12:03:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'ssl_certificate' => 'encrypted',
|
|
|
|
|
'ssl_private_key' => 'encrypted',
|
2025-02-03 21:35:00 +00:00
|
|
|
'subject_alternative_names' => 'array',
|
2025-01-29 12:03:13 +00:00
|
|
|
'valid_until' => 'datetime',
|
|
|
|
|
];
|
|
|
|
|
|
2025-02-04 14:32:56 +00:00
|
|
|
public function application()
|
2025-01-29 12:03:13 +00:00
|
|
|
{
|
2025-02-04 14:32:56 +00:00
|
|
|
return $this->morphTo('resource');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function service()
|
|
|
|
|
{
|
|
|
|
|
return $this->morphTo('resource');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function database()
|
|
|
|
|
{
|
|
|
|
|
return $this->morphTo('resource');
|
2025-01-29 12:03:13 +00:00
|
|
|
}
|
2025-01-31 11:35:34 +00:00
|
|
|
|
|
|
|
|
public function server()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Server::class);
|
|
|
|
|
}
|
2025-01-29 12:03:13 +00:00
|
|
|
}
|