Abstract
Now we have learned to create tables through Migration and Tinker. We can also use Eloquent ORM to do the same. We also have learned to update or edit our database records. Suppose we have made three tables: 'users', 'songs', and 'singers'. Now in our 'songs' table we have two tableĀcells, as you have probably noticed. One is 'user_id' and the other is 'singer_id'. So presumably, a user inserts a song, and he has an ID. In my database I have inserted three users: first, second, and third. So they have user IDs like 1, 2, and 3, respectively.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
Ā© 2017 Sanjib Sinha
About this chapter
Cite this chapter
Sinha, S. (2017). Eloquent Relations. In: Beginning Laravel. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-2538-7_16
Download citation
DOI: https://doi.org/10.1007/978-1-4842-2538-7_16
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-2537-0
Online ISBN: 978-1-4842-2538-7
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books