diff --git a/src/Domain/Models/Output/ModelDocBlock.php b/src/Domain/Models/Output/ModelDocBlock.php index 03ac8a0..806e005 100644 --- a/src/Domain/Models/Output/ModelDocBlock.php +++ b/src/Domain/Models/Output/ModelDocBlock.php @@ -32,6 +32,11 @@ public function render(): void protected function docblock(): string { + $name = explode('\\', $this->model->fqcn); + $last = array_pop($name); + $last = 'NextIdeHelper' . $last; + $name[] = $last; + return Collection::make([ '/**', $this->properties(), @@ -43,6 +48,7 @@ protected function docblock(): string $this->phpstanMethods(), $this->queryMixin(), $this->factory(), + ' * @mixin ' . implode('\\', $name), ' */', ]) ->map(fn (?string $line): string => $this->line($line)) diff --git a/src/Support/Output/IdeHelperFile.php b/src/Support/Output/IdeHelperFile.php index cf5ed02..4d2dc26 100644 --- a/src/Support/Output/IdeHelperFile.php +++ b/src/Support/Output/IdeHelperFile.php @@ -31,6 +31,10 @@ public function getOrAddClass(string $fqcn): Klass ->trim('\\'); $class = Str::afterLast($fqcn, '\\'); + if (!str_contains($class, '__')) { + $class = 'NextIdeHelper' . $class; + } + return $this->getOrAddNamespace($namespace)->getOrAddClass($class); }