Skip to content

Instantly share code, notes, and snippets.

@VaguelyOnline
Created December 29, 2017 14:57
Show Gist options
  • Save VaguelyOnline/75d42429d21998540a7a670fd43a29e7 to your computer and use it in GitHub Desktop.
Save VaguelyOnline/75d42429d21998540a7a670fd43a29e7 to your computer and use it in GitHub Desktop.
// NB - Activity is a subclass of an Eloquent Model
class Exercise extends Activity
{
public function details()
{
return $this->morphTo('details', 'details_type', 'id');
}
}
// ... as doe the parent class here...
class HotspotExerciseDetails extends ExerciseDetails
{
public function images()
{
return $this->hasMany('HotspotImage', 'hotspot_exercise_detail_id');
}
}
class HotspotImage extends Eloquent
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment