I'm using Paris for my new project...
Let's say I have 3 tables: users, books and borrows:
users: id/name
books: id/title
borrows: users_id/books_id/borrow_date/return_date
In Books class:
function users()
{
return $this->has_many_through('Users', 'Borrows');
}
In Users class:
function books()
{
return $this->has_many_through('User', 'Borrows');
}
Everything is fine, I can access to borrowed books by each user and list of users who borrowed a single book before, but I'm wondering that how can I access to borrow_date
and return_date
column/property of Borrows table/class?