I have 3 models:
BookAuthorOwner
Book has:
idnamephotoauthor_idowner_idis_available
Author has:
idnamephoto
Owner has:
idnamephotobook_id
A book can have multiple Authors and Owners.
How can I store more single id in author_id and owner_id?
CodePudding user response:
If the author has many books, and the book have many authors, than it’s a many to many relationship and you will need intermediate tables author_book and owner_book. In order to be able to define many author ids for one a book and many books for one author. Check the Laravel doc here for implementation details https://laravel.com/docs/9.x/eloquent-relationships#many-to-many
Good luck.
