38 lines
873 B
PHP
38 lines
873 B
PHP
<?php
|
|
|
|
namespace App\Domains\Domain\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Support\Str;
|
|
|
|
class Domain extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'verified_at' => 'datetime',
|
|
'ssl_issued_at' => 'datetime',
|
|
'ssl_expires_at' => 'datetime',
|
|
'is_default' => 'boolean',
|
|
];
|
|
|
|
public function workspace(): BelongsTo
|
|
{
|
|
return $this->belongsTo(\App\Domains\Workspace\Models\Workspace::class);
|
|
}
|
|
|
|
public function isVerified(): bool
|
|
{
|
|
return $this->verified_at !== null;
|
|
}
|
|
|
|
protected static function newFactory(): \Database\Factories\DomainFactory
|
|
{
|
|
return \Database\Factories\DomainFactory::new();
|
|
}
|
|
}
|