Eloquent Relations

  • Sanjib Sinha


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.


User Model User Class Database Table Public Function Contact Object 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Copyright information

© Sanjib Sinha 2017

Authors and Affiliations

  • Sanjib Sinha
    • 1
  1. 1.HowrahIndia

Personalised recommendations