Laravel属于一对一的低谷,许多人都属于许多(介于两者之间)
我一直在寻找解决方案,但找不到。
情况:
资源已连接到事件,多个资源可以连接到多个事件(许多事件)。
许多干预措施一次仅连接到1个单一事件(一对一个事件)。
我想做什么?
我想在资源和干预措施之间建立关系。但是...当然,与事件相关的资源肯定必须考虑到。因此,可能只有针对与干预链接的事件的资源(在屏幕截图中您可以从我的UML中找到零件)
在简短中,
我想将许多资源连接到我的干预措施中,但是只有那些在父事件上可用的人。
我尝试过Hasmanytrough,Wityhpivot,但没有成功。 我真的很想尽可能多地做到这一点,因此,如果没有自定义查询,但是如果没有其他选择,我对一切都开放。
I've been looking around for a fix but couldn't find it.
The situation:
Resources are connected to an Event, multiple resources can be connected to multiple events (many to Many).
Many Interventions are connected to only 1 single event at a time (One to Many).
What am I trying to do?
I'd like to make a relation between Resources and Interventions. But... of course the resources that are linked to the event must certainly be taken into account. So there may only be resources that are specific to the event that is linked to the intervention (In the screenshot you can find a part from my UML)
In short
I want to connect many resources to my interventions, but only those that are available on the parent Event.
I've tried HasManyTrough, wityhPivot but without a success.
I'd realy like to do it as much Laravelish as possible, so without custom queries, but if there are no other options, I'm open for everything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果任何语法错误,请让我知道。
请尝试一下,让我知道是否有效。
Let me know in case of any syntax error.
Please try this and let me know worked or not.