Well, option 2 would work in that example. It’s not the prettiest, but it solves the problem:
Users have many Bookrules
Books have many Bookrules
Actions have many Bookrules
Bookrules has one Book
Bookrules has one User
Bookrules has one Action
Your model tables would be:
users, books, actions, bookrules
Your relationship tables would be
actions_bookrules
bookrules_books
bookrules_users
You could then get the books through
$user->bookrules->get();
foreach($user->bookrules->all as $bookrule) {
$book = $bookrule->book->get();
$action = $bookrule->action->get();
}
Update: I forgot to mention that this will generate a lot of queries on the server. You might be able to reduce them using some of the above mentioned additions to DM.