Laravel Eloquent polymorphic relationships to model hierarchy/inheritance
<p>I am modelling a report which depending on its type (missing person, wanted, etc) could contain different fields but each type shares a number of fields. This I think is what differentiates this question from say: <a href="https://stackoverflow.com/questions/35100615/using-eloquent-polymorphic-relationships-to-categorise-data-in-laravel">this question</a> where the fields are common across all types. </p>

<p>At the moment I have created a report model with an integer field indicating its type which references a type table. The advantage is that this is an easy model to understand and implement. It means that I can also easily search for objects. On the other hand, this means that some fields do not make sense for some models and thus are always null. As I add fields unique to the individual types I end up with many columns in the table of which many are null.</p>

<p>I would like some advice on using Laravel's (5.2) polymorphic relationships. The way I envision this is that I will have a base report model that contains all the shared fields and have the MorphTo fields; then have the different types separate containing their unique fields in a one-to-one relationship with the reports model. Is this possible and does this even make sense? The problems I see are that I lose the ability to search across all "reports" regardless of type. Or is there a way around this like say Java where inheritance allows for sub-classes to be considered members of the superclass?</p>

<p>A rough diagram of such relationships is shown below. Reports holds the shared fields while Wanted and Missing have unique fields.</p>

<p><a href="https://i.stack.imgur.com/p4CFl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/p4CFl.png" alt="Relationship between wanted and missing reports, and the base report"></a></p>