I have three tables in my database: Users
, Books
, and Reading
. The structure of Reading
is:
id, user_id, book_id
Now, I need to access to all the books that the user is reading.
First, I would like to know which kind of relationship is, one to many, many to many, Has Many Through, etc. And what do I have to specify in each model? I mean, in the users model hasMany('Reading')
or whatever.
I want to access with something like this: Auth::user()->reading()->books()->get()
or something similar.