F
Filamentβ€’17mo ago
N. Jacobsen

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β€’17mo ago
Dennis Koch
Dennis Kochβ€’17mo ago
HasMany is disassociate and not detach, isn't it?
N. Jacobsen
N. JacobsenOPβ€’17mo ago
Tried a assiciate too, then it just referes to the other model.
N. Jacobsen
N. JacobsenOPβ€’17mo ago
N. Jacobsen
N. JacobsenOPβ€’17mo ago
The Org model has a belongsto and function called Country not countries
Solution
Dennis Koch
Dennis Kochβ€’17mo ago
You probably need to set $inverseRelationship property on the RM to "country"
N. Jacobsen
N. JacobsenOPβ€’17mo ago
When in attach or Assosicate?
Dennis Koch
Dennis Kochβ€’17mo ago
Neither. Relation Manager
N. Jacobsen
N. JacobsenOPβ€’17mo ago
oh heck me your right Thank you very much, still learning filament πŸ˜„
N. Jacobsen
N. JacobsenOPβ€’17mo ago
Thanks πŸ˜„
N. Jacobsen
N. JacobsenOPβ€’17mo 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β€’17mo 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
Want results from more Discord servers?
Add your server