35 lines
717 B
PHP
35 lines
717 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
|
|
|
class EmailTemplate extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'key',
|
|
'subject_template',
|
|
'html_template',
|
|
'text_template',
|
|
'entity_types',
|
|
'allow_attachments',
|
|
'active',
|
|
];
|
|
|
|
protected $casts = [
|
|
'active' => 'boolean',
|
|
'entity_types' => 'array',
|
|
'allow_attachments' => 'boolean',
|
|
];
|
|
|
|
public function documents(): MorphMany
|
|
{
|
|
return $this->morphMany(Document::class, 'documentable');
|
|
}
|
|
}
|