Skip to content

Instantly share code, notes, and snippets.

@graymic
Last active August 29, 2015 14:09
Show Gist options
  • Save graymic/76977e3717ba96408bfc to your computer and use it in GitHub Desktop.
Save graymic/76977e3717ba96408bfc to your computer and use it in GitHub Desktop.
Polymorphic Model Namespaces
<?php Some\Extended\Models\Namespace;
class MyBespokeModel extends Some\Other\Parent\Namespace\Model {
/**
* As this class is \App\Api\Models - Map the polymorphic relationship to this model
* so that it can be accessed either by Common\Models or Api\Models.
*
* @var string
*/
protected $morphClass = 'SharedBaseNameModel';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment