Attach and Detach issue

I have an issue where I countries which has many orgnazations. Issue is when I try to detach it it gives me this error
Solution:
You probably need to set $inverseRelationship property on the RM to "country"
Jump to solution
13 Replies
N. Jacobsen
N. JacobsenOPβ€’2y ago
Dennis Koch
Dennis Kochβ€’2y ago
HasMany is disassociate and not detach, isn't it?
N. Jacobsen
N. JacobsenOPβ€’2y ago
Tried a assiciate too, then it just referes to the other model.
N. Jacobsen
N. JacobsenOPβ€’2y ago
N. Jacobsen
N. JacobsenOPβ€’2y ago
The Org model has a belongsto and function called Country not countries
Solution
Dennis Koch
Dennis Kochβ€’2y ago
You probably need to set $inverseRelationship property on the RM to "country"
N. Jacobsen
N. JacobsenOPβ€’2y ago
When in attach or Assosicate?
Dennis Koch
Dennis Kochβ€’2y ago
Neither. Relation Manager
N. Jacobsen
N. JacobsenOPβ€’2y ago
oh heck me your right Thank you very much, still learning filament πŸ˜„
N. Jacobsen
N. JacobsenOPβ€’2y ago
Thanks πŸ˜„
N. Jacobsen
N. JacobsenOPβ€’2y ago
I have an additional issue if you don't mind.. πŸ™‚ I'm trying to show users under orgs with attach. I'm having difficulties getting their role from OrgUser table..
Dennis Koch
Dennis Kochβ€’2y ago
You can't pass an argument to a relationship Fix your Laravel relationship first. Then connect it to Filament I don't think you need a wherePivot

Did you find this page helpful?