Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: The model [TomatoPHP\FilamentAlerts\Models\NotificationsTemplate] does not have a relationship named [branch]. #7

Open
maukoese opened this issue Dec 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@maukoese
Copy link

maukoese commented Dec 9, 2024

What happened?

I have multitenancy enabled, and this breaks the plugin. I get the following error:

The model [TomatoPHP\FilamentAlerts\Models\NotificationsTemplate] does not have a relationship named [branch]. You can change the relationship being used by passing it to the [ownershipRelationship] argument of the [tenant()] method in configuration. You can change the relationship being used per-resource by setting it as the [$tenantOwnershipRelationshipName] static property on the [TomatoPHP\FilamentAlerts\Filament\Resources\NotificationsTemplateResource] resource class.

How to reproduce the bug

Enable multitenancy with a custom Tenant model (Branch, in my case)

Package Version

2.2

PHP Version

8.4

Laravel Version

11.9

Which operating systems does with happen with?

macOS

Notes

I suppose the solution would be to allow creating a custom template model that extends the other one; then we can whitelist it from tenancy using the $isScopedToTenant property.

// app/Models/MyNotificationsTemplateModel.php
protected static bool $isScopedToTenant = false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant