seancheung/history

primary key

dunkel015 opened this issue · 1 comments

What happens when the primary key is composed?

The history table is already in a many-to-many polymorphic relation. Thus I don't think a model with compound primary key will be supported.

This won't work as you expect:
image

Due to HistoryObserver.php
image

Compound primary keys cannot be supported by default because it's not generic(morphMany does support only single primary keys). You'll need to create separate history model for each tracked models and tweak something about the mechanism.