Skip to content

Commit d8fb4d7

Browse files
committed
Use belongs to.
1 parent 0cb587b commit d8fb4d7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Models/MailTemplate.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ class MailTemplate extends Model implements MailTemplateable
3838

3939
public function placeholders()
4040
{
41-
return $this->hasMany(MailTemplatePlaceholder::class, 'mail_template_id');
41+
return $this->hasMany(
42+
config('mailator.templates.placeholder_model') ?? MailTemplatePlaceholder::class, 'mail_template_id'
43+
);
4244
}
4345

4446
public function htmlWithInlinedCss(): string

src/Models/MailTemplatePlaceholder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class MailTemplatePlaceholder extends Model
2222

2323
public function mailTemplate()
2424
{
25-
return $this->belongsTo(MailTemplate::class, 'mail_template_id');
25+
return $this->belongsTo(
26+
config('mailator.templates.template_model') ?? MailTemplate::class, 'mail_template_id'
27+
);
2628
}
2729
}

0 commit comments

Comments
 (0)