Skip to content

Instantly share code, notes, and snippets.

//
// method for a base Model class
//
/**
* Define a has-many-through-pivot relationship.
*
* @param $related related desired model
* @param $through middle model
* @param $firstRelation the many-to-many relation we use on the through model
* @param $secondRelation the second many-to-many relation on the through table which references farparent