Skip to content

Instantly share code, notes, and snippets.

@joetannenbaum
Created January 30, 2017 16:43
Show Gist options
  • Save joetannenbaum/55038a628795ae5745d0b339ea17a49e to your computer and use it in GitHub Desktop.
Save joetannenbaum/55038a628795ae5745d0b339ea17a49e to your computer and use it in GitHub Desktop.
<?php
class MyModel extends Model
{
public function history()
{
return $this->morphMany(History::class, 'my_model_table', 'reference_table', 'reference_id');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment