mailwolt/app/Models/TlsaRecord.php

20 lines
490 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class TlsaRecord extends Model
{
protected $fillable = [
'domain_id','service','host','usage','selector','matching','hash','cert_path',
];
public function domain() { return $this->belongsTo(Domain::class); }
public function getDnsStringAttribute(): string
{
return "{$this->service}.{$this->host}. IN TLSA {$this->usage} {$this->selector} {$this->matching} {$this->hash}";
}
}