vendredi 21 août 2020

Relationship between user and store

I need to create a relationship between user and many stores. I have created a three models

Store Model

id name email            phone       info
1  xyz  xyz@gmail.com    9329292922  Small Store
2  abc  abc@gmail.com    9494949449  Some Store

User Model

id name email                  
1  ewd  ewd@gmail.com   
2  xcv  xcv@gmail.com    

User_Store

user_id     store_id
   1          1
   1          2

What does the user_store model contain relations whether it is belongstoMany or hasmany?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire