Call to undefined method App\Models\OrderLine::orderLines()
when i want to edit a order on my website i get this error i don't get directed to the edit page and same as for making one i get the error but it does make a order i don't know how to fix it so i can edit it
15 Replies
this is my OrderLineResource
and this is my OrderLine Model
I can’t read your code because I’m on mobile and you decided to upload some txt files, but you probably didn’t specify the relation correctly
yeah the text was to long and i don't have nitro so i needed to sent it in txt
i just can't find where the relation is not good because in a other script that is working i almost have the same as that script
Can you post your OrderLinesRelationManager::class ?
Or you could have shared a Gist as mentioned in #✅┊rules
You don't have a relationship named 'orderLines' in your model.
Change the relationship in your OrderLinesRelationManager
protected static string $relationship = 'orderLines';
to what should i change it?
To the actual name of that relationship you want to use.
What’s the relationship called on the Order model?
i have multiple relations to scripts
this is my order model
Sorry it’s not really readable because you don’t use code formatting 🤷🏼♂️ See #✅┊rules
i don't know how to make a github git because school already made a branch in gitlab
So it’s not the wrong relation but the relation manager is using the
OrderLine
model instead of Order
model. You can just swap the model on the RMtheres no way i was looking for that for so long 😭
pff crazy how 1 word can take so much time to find 🤣 but atleast thanks for the help! 😄