AttachAction problem with Relations?
When I try to "Attach" a Panel(resource) in Group(resource), I get this error.
Group-Model:
Panel-Model:
GroupResource:
PanelsRelationManager:
SQL-Scheme:
So now; why is it looking for groups instead of group?
5 Replies
Your method in the Panel model seems to be called 'group' not 'groups'
When I call it "groups" I get another error.. 😄
Call to undefined method Illuminate\Database\Eloquent\Relations\HasMany::getQualifiedRelatedKeyName()
Because it's one to many, not many to many. so it's panelS and group. Not panels and groups..
Define the
$inverseRelationship
on the relation manager as group
Also, I think
HasMany
should be associate
and not attach
:
https://filamentphp.com/docs/3.x/panels/resources/relation-managers#associating-and-dissociating-records