create record when using tenancy
Does filament auto associate created model to current tenant? .. if not how would i do that?
8 Replies
Probably in a page hook, like
afterCreate()
?I though it will auto associate it, since it filters it in first place,
I asked because idk if its a bug or intended.
Anyway afrer create looks great idea
I'm not sure actually, there may be an automated way. I have not yet tried a multi-tenant project with Filament π
me too, still trying it out.
yes, it does automatically associate the record with the tenant.
In your tenant model, you should define the relation between your resource model and your tenant model.
for example:
then Filament will be able to automatically associate the model with the tenant model
nope, it didn't with me,
had to use aftercreate method
@saadeguilherme
after more digging , i see sometimes it works and sometimes not, idk why, i will dig more.
show me an example where it does not work
resource + tenant model + model