Closed EvangelosGeorgiou closed 3 months ago
Currently the theme() relation foreign key on the EmailTemplate model is like this
public function theme() { return $this->belongsTo(EmailTemplateTheme::class, 'vb_email_templates_themes_id')->withDefault(function ($model) { return EmailTemplateTheme::where('is_default', true)->first(); }); }
you should get the table name from the config file and add the 'id' in the end
return $this->belongsTo(EmailTemplateTheme::class, config('filament-email-templates.theme_table_name') . '_id')->withDefault(function ($model) { return EmailTemplateTheme::where('is_default', true)->first(); });
Hey thank you for reporting and so sorry haven't replied sooner :-(. You know how sometimes life happens.
This has been fixed, thank you for letting us know and hope you sorted your own workaround.
Currently the theme() relation foreign key on the EmailTemplate model is like this
public function theme() { return $this->belongsTo(EmailTemplateTheme::class, 'vb_email_templates_themes_id')->withDefault(function ($model) { return EmailTemplateTheme::where('is_default', true)->first(); }); }
you should get the table name from the config file and add the 'id' in the end
return $this->belongsTo(EmailTemplateTheme::class, config('filament-email-templates.theme_table_name') . '_id')->withDefault(function ($model) { return EmailTemplateTheme::where('is_default', true)->first(); });