Skip to main content

Eloquent Relations

  • Chapter
  • First Online:
Beginning Laravel
  • 1925 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 24.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints 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

Publish with us

Policies and ethics