diff --git a/src/Coders/Model/Model.php b/src/Coders/Model/Model.php index 4ced5798..c6d62a83 100644 --- a/src/Coders/Model/Model.php +++ b/src/Coders/Model/Model.php @@ -502,7 +502,12 @@ public function getBaseNamespace() */ public function withParentClass($parent) { - $this->parentClass = '\\' . ltrim($parent, '\\'); + $thisParentClass = '\\'; + if (! is_null($parent)) { + $thisParentClass = $thisParentClass . ltrim($parent, '\\'); + } + + $this->parentClass = $thisParentClass; return $this; }