Home Laravel one to many relation with a one to one relation
Reply: 0

Laravel one to many relation with a one to one relation

user1051
1#
user1051 Published in April 20, 2018, 6:01 pm

I may be going about this wrong but i need a model to have a one to many and a one to one relation.

I have the following tables:

  • bots
  • bot_settings
  • message
  • section

I have the following relations:

  • Bot belong to a Section (one to many)
  • BotSettings belong to a Bot (one to one)
  • ArMessage belong to a Section (one to many)

All of this is working as expected the one im having a problem with:

  • ArMessage also have a one to one relation with the BotSettings

Aa i already have them belonging to a section im not sure how i can also link them to a BotSetttings i think i may need to alter my relations but not sure how.

Iv read the docs and tried everything from there not sure what to try now.

Any help would be much appreciated!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.33551 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO