ldc-web/app/Models/EmailAddress.php

44 lines
774 B
PHP
Raw Normal View History

2022-06-13 17:40:44 +02:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class EmailAddress extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'account', 'password',
'domain_name_id'
];
2022-06-13 17:40:44 +02:00
// * METHODS
/**
* domain_name getter
*
* @return mixed
*/
public function getDomainNameAttribute()
{
$dn = DomainName::findOrFail($this->domain_name_id);
return $dn->utf8_name;
}
2022-06-15 14:09:52 +02:00
// * RELATIONSHIPS
/**
* BelongsTo domain name relation
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function domainName()
{
return $this->belongsTo(DomainName::class);
}
2022-06-13 17:40:44 +02:00
}