Issue with RelationManager in one direction when I want to attach an element
Hi , I'm encountering the following issue with 2 models on which I have deployed a Many-to-Many relationship .
So I have created two RelationManagers that I 'm using back and forth on my 2 resources defined and it seems to work but within one of my resources when I'm using the RelationManager associated and that I want to attach an existing element in my table . I got the error message -> BadMethodCallException: "Call to undefined method App\Models\ ...". I have doublecheck many time my relation in both of my models but the relation is well present .
In the same error page for the explanation about bad method call , it seems that it suggest me the correct relationship
If I'm defining the same without the RelationManager for this resource but just using a regular expression select within the form with the relationship and so on then it is working fine . In that case my pivot table is well updated .
I don't know why it is not working because I'm using the same relation but back and forth
My Model 1 relation is defined as follow:
And I think that this one if working well because I can acess my users defined in this model
The other Model relation is defined as :
`
It is just with the attach action on this relation that it is not working . The DetachAction is working well
As newbie , not sure what I'm doing wrong .
Many thanks
1 Reply
I found the issue , I need to define the following implementation
`
So it is the reverse name of my relation
But I don't get why I need to put it in one RelationManager class and not the other
Anyone for an explanation ?
thank you